jsumners / feedparser

Automatically exported from code.google.com/p/feedparser
Other
0 stars 0 forks source link

crash when chardet.detect data on python3.4 #429

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I use feedparser on coreos when i parse a raw str rss string i crash.

  File "/usr/local/lib/python3.4/dist-packages/feedparser.py", line 3966, in parse
    data, result['encoding'], error = convert_to_utf8(http_headers, data)
  File "/usr/local/lib/python3.4/dist-packages/feedparser.py", line 3768, in convert_to_utf8
    chardet_encoding = str(chardet.detect(data)['encoding'] or '', 'ascii', 'ignore')
TypeError: decoding str is not supported

change line 3768 

    chardet_encoding = chardet.detect(data)['encoding'] or ''

Fixed!

Original issue reported on code.google.com by lmjubu...@gmail.com on 10 Oct 2014 at 10:04