dimones / feedparser

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

TypeError: cannot concatenate 'str' and 'list' objects (microformat parsing) #402

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Just run 
   feedUrl="http://www.senildomelo.blogspot.com.br/feeds/posts/default"
   feed = feedparser.parse( feedUrl )

What is the expected output? What do you see instead?
   I expect it to parse the feed (the feed works fine in firefox, for example). But instead I get this exception:

Traceback (most recent call last):
  File "./universalFeedParser.py", line 16, in <module>
    feed = feedparser.parse( feedUrl )
  File "/usr/local/lib/python2.7/dist-packages/feedparser.py", line 4001, in parse
    saxparser.parse(source)
  File "/usr/lib/python2.7/dist-packages/drv_libxml2.py", line 231, in parse
    _d(reader.Name()))
  File "/usr/local/lib/python2.7/dist-packages/feedparser.py", line 1854, in endElementNS
    self.unknown_endtag(localname)
  File "/usr/local/lib/python2.7/dist-packages/feedparser.py", line 701, in unknown_endtag
    method()
  File "/usr/local/lib/python2.7/dist-packages/feedparser.py", line 1704, in _end_content
    value = self.popContent('content')
  File "/usr/local/lib/python2.7/dist-packages/feedparser.py", line 1021, in popContent
    value = self.pop(tag)
  File "/usr/local/lib/python2.7/dist-packages/feedparser.py", line 927, in pop
    mfresults = _parseMicroformats(output, self.baseuri, self.encoding)
  File "/usr/local/lib/python2.7/dist-packages/feedparser.py", line 2518, in _parseMicroformats
    p.vcard = p.findVCards(p.document)
  File "/usr/local/lib/python2.7/dist-packages/feedparser.py", line 2367, in findVCards
    sPostalCode + ';' +
TypeError: cannot concatenate 'str' and 'list' objects

What version of the product are you using? On what operating system?
>>> BeautifulSoup.__version__
'3.2.1'

>>> feedparser.__version__
'5.1.3'

python --version
Python 2.7.3

Description:    Ubuntu 12.04.2 LTS
Release:    12.04
Codename:   precise

Please provide any additional information below.

I've attached a file with the feed, but I think it's happening for others 
blogspot.com sites.

Original issue reported on code.google.com by oniltonm...@gmail.com on 21 May 2013 at 8:43

Attachments:

GoogleCodeExporter commented 9 years ago
It' seems to be related to microformats parsing.

If I use:

feedparser.PARSE_MICROFORMATS = 0

Everything works fine.

Original comment by oniltonm...@gmail.com on 21 May 2013 at 5:30

GoogleCodeExporter commented 9 years ago
Microformat support has been removed in git master. This will not be an issue 
moving forward.

Original comment by kurtmckee on 10 Jul 2014 at 5:04