Skip to content

Commit b5b91cc

Browse files
committed
Merge pull request #238 from gsnedders/inputstream_update
Update prescan to scan 1024 bytes; r=nobody!
2 parents 3b7e017 + 9ba3b28 commit b5b91cc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

html5lib/inputstream.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ def __init__(self, source, encoding=None, parseMeta=True, chardet=True):
421421
# Encoding Information
422422
# Number of bytes to use when looking for a meta element with
423423
# encoding information
424-
self.numBytesMeta = 512
424+
self.numBytesMeta = 1024
425425
# Number of bytes to use when using detecting encoding using chardet
426426
self.numBytesChardet = 100
427427
# Encoding to use if no other information can be found
@@ -430,6 +430,7 @@ def __init__(self, source, encoding=None, parseMeta=True, chardet=True):
430430
# Detect encoding iff no explicit "transport level" encoding is supplied
431431
if (self.charEncoding[0] is None):
432432
self.charEncoding = self.detectEncoding(parseMeta, chardet)
433+
assert self.charEncoding[0] is not None
433434

434435
# Call superclass
435436
self.reset()

0 commit comments

Comments
 (0)