diff --git a/utils/feedparser.py b/utils/feedparser.py index 16c4506ad..4654b5787 100755 --- a/utils/feedparser.py +++ b/utils/feedparser.py @@ -3740,7 +3740,7 @@ def convert_to_utf8(http_headers, data): chardet_encoding = None tried_encodings = [] if chardet and data: - chardet_encoding = unicode(chardet.detect(data)['encoding'], 'ascii', 'ignore') + chardet_encoding = unicode(chardet.detect(data)['encoding'] or "", 'ascii', 'ignore') # try: HTTP encoding, declared XML encoding, encoding sniffed from BOM for proposed_encoding in (rfc3023_encoding, xml_encoding, bom_encoding, chardet_encoding, u'utf-8', u'windows-1252', u'iso-8859-2'):