diff options
author | Leonard Richardson <leonardr@segfault.org> | 2015-06-25 07:04:00 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2015-06-25 07:04:00 -0400 |
commit | fee5d1d8f62254939939eb97ac56d7c4f158e6cf (patch) | |
tree | da3fe37e5b5cf93c871ce1b2ec60cc7bfc2448a4 /bs4/dammit.py | |
parent | bc85e533729738de1100fabe23ddc71b41933a7a (diff) |
Fixed a crash in Unicode, Dammit's encoding detector when the name
of the encoding itself contained invalid bytes. [bug=1360913]
Diffstat (limited to 'bs4/dammit.py')
-rw-r--r-- | bs4/dammit.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bs4/dammit.py b/bs4/dammit.py index 59640b7..68ed81f 100644 --- a/bs4/dammit.py +++ b/bs4/dammit.py @@ -306,7 +306,7 @@ class EncodingDetector: declared_encoding_match = html_meta_re.search(markup, endpos=html_endpos) if declared_encoding_match is not None: declared_encoding = declared_encoding_match.groups()[0].decode( - 'ascii') + 'ascii', 'replace') if declared_encoding: return declared_encoding.lower() return None |