Skip to content

Commit 6d7e66c

Browse files
committed
Fix seeking to anything except 0 with BufferedStream.
Previously, given a non-zero location to seek to, we would always seek to the start of the second buffered chunk.
1 parent 80c9044 commit 6d7e66c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

html5lib/inputstream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def seek(self, pos):
6767
offset = pos
6868
i = 0
6969
while len(self.buffer[i]) < offset:
70-
offset -= pos
70+
offset -= len(self.buffer[i])
7171
i += 1
7272
self.position = [i, offset]
7373

0 commit comments

Comments
 (0)