A1ex2015 / feedparser

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

Can't parse feed from url ('str' does not support the buffer interface) #432

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
>>> import feedparser
>>> d = feedparser.parse('http://feedparser.org/docs/examples/atom10.xml')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.4/site-packages/feedparser.py", line 3991, in parse
    saxparser.parse(source)
  File "/usr/lib64/python3.4/site-packages/drv_libxml2.py", line 190, in parse
    _d(reader.LocalName()))
  File "/usr/lib64/python3.4/site-packages/drv_libxml2.py", line 70, in _d
    return _decoder(s)[0]
  File "/usr/lib64/python3.4/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
TypeError: 'str' does not support the buffer interface

feedparser-5.1.3, python-3.4.1, linux-3.16.5

Original issue reported on code.google.com by pkozlov....@gmail.com on 3 Dec 2014 at 8:50

GoogleCodeExporter commented 9 years ago
By the way, the same error I see when try to parse feed from string.

>>> rawdata = """<rss version="2.0">
... <channel>
... <title>Sample Feed</title>
... </channel>
... </rss>"""
>>> d = feedparser.parse(rawdata)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.4/site-packages/feedparser.py", line 3991, in parse
    saxparser.parse(source)
  File "/usr/lib64/python3.4/site-packages/drv_libxml2.py", line 190, in parse
    _d(reader.LocalName()))
  File "/usr/lib64/python3.4/site-packages/drv_libxml2.py", line 70, in _d
    return _decoder(s)[0]
  File "/usr/lib64/python3.4/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
TypeError: 'str' does not support the buffer interface

Original comment by pkozlov....@gmail.com on 3 Dec 2014 at 8:55

GoogleCodeExporter commented 9 years ago
I've not tested with Python 3.4, I'll look into this. Thanks for reporting this!

Original comment by kurtmckee on 28 Mar 2015 at 6:13