Forums

Feedparser in Python3

Hi have the following issue with using feedparser on Python 3.4

02:09 ~ $ python3
Python 3.4.0 (default, Jun 19 2015, 14:20:21) 
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import feedparser
>>> feed = feedparser.parse('http://www.abc.net.au/news/feed/45910/rss.xml')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  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

I've seen other people with this issue with 5.1.3 feedparser and resolved after updating feedparser. Is anyone else having this issue?

Hi there,

try a

pip3.4 install --user --upgrade feedparser

We'll get the package upgraded in the default system image as soon as poss...

Didn't realise pip had user setting, makes sense though. Thanks.