This commit is contained in:
Kovid Goyal 2020-04-29 08:36:47 +05:30
commit 92c412996f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -115,7 +115,7 @@ class HTMLFile(object):
encoding = detect_xml_encoding(src)[1] encoding = detect_xml_encoding(src)[1]
if encoding: if encoding:
try: try:
header = header.decode(encoding) header = header.decode(encoding, errors='ignore')
except ValueError: except ValueError:
pass pass
self.is_binary = level > 0 and not bool(self.HTML_PAT.search(header)) self.is_binary = level > 0 and not bool(self.HTML_PAT.search(header))