dimones / 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