8000 Not streaming yet, but the Ruby implementation can now deal with un-s… · awesome-python/html5lib-python@e638ba3 · GitHub
[go: up one dir, main page]

Skip to content

Commit e638ba3

Browse files
committed
Not streaming yet, but the Ruby implementation can now deal with un-seekable
inputs (like STDIN!) --HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40787
1 parent 3b11ecf commit e638ba3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/inputstream.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ def detectBOM(self):
126126
encoding = bomDict.get(string[:2]) # UTF-16
127127
seek = 2
128128

129+
# Set the read position past the BOM if one was found, otherwise
130+
# set it to the start of the stream
129131
self.seek(string, encoding and seek or 0)
130132

131133
return encoding

0 commit comments

Comments
 (0)
0