8000 Fix seeking to anything except 0 with BufferedStream. · blag/html5lib-python@6d7e66c · GitHub
[go: up one dir, main page]

Skip to content
< 8000 header class="HeaderMktg header-logged-out js-details-container js-header Details f4 py-3" role="banner" data-is-top="true" data-color-mode=light data-light-theme=light data-dark-theme=dark>

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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)
0