Closed GoogleCodeExporter closed 9 years ago
I've come across a similar issue. A media:title value will overwrite the title
value.
See attached bug.xml feed to reproduce.
FYI, issue #61 is also the same as this one.
I've attached a patch that sets the _start_dc_title and _start_media_title
handlers
to a new method, _start_title_low_pri, which attempts to set the title only if
it
hasn't been set yet.
The patch works with the attached feed, fixes the original issue described in
this
report, and also passes the feedparser-tests suite (well, except for the 2
encoding
tests that fail even with included 4.1 release).
Thanks for your work, Mark!
Original comment by j...@codefork.com
on 28 Oct 2007 at 7:42
Attachments:
Here's a much smaller (non-validating) test case:
<rss version="2.0">
<channel>
<item>
<title>Test</title>
<media:title type="plain">Test</media:title>
</item>
</channel>
</rss>
Unpatched the title ends up a garbled mess:
>>> import feedparser
>>> parsed = feedparser.parse('http://localhost/test.xml')
>>> print parsed['items'][0]['title']
M�-
The patch above fixes it, thanks!
Original comment by feedsa...@gmail.com
on 1 Nov 2007 at 11:56
I have the same issue and can confirm that the patch fixed it. Thanks!
Original comment by dre...@gmail.com
on 3 May 2008 at 9:29
The patch no longer applies, but at least the media:title portion of this seems
to be
fixed in SVN anyway (I'm testing at revision 287).
Original comment by mary-goo...@puzzling.org
on 25 Jul 2008 at 9:04
Hi all,
I am fairly new to Python and the processing of feeds. FeedParser is great and
I am
glad it's around. However I have been great problems with a WordPress Atom feed
that
just would not parse correctly. Happily the patch works a treat and I can stop
peering at code thinking I had done something wrong!
Thanks everyone
Bob
Original comment by BobToo...@gmail.com
on 21 May 2009 at 11:44
Please verify your bug against the current version of the code in SVN and
comment on:
http://code.google.com/p/feedparser/issues/detail?id=76 instead.
Original comment by adewale
on 16 Dec 2009 at 2:34
Original issue reported on code.google.com by
pilg...@gmail.com
on 19 Apr 2007 at 5:14Attachments: