HaveF / feedparser

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

pubDate should map to `published`, not `updated` #310

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
>>> f = 
feedparser.parse('http://gdata.youtube.com/feeds/base/users/ethoslab/uploads?ord
erby=updated&alt=rss&v=2')
>>> print f.entries[0].updated

What is the expected output?

u'2011-12-03T08:23:57.000Z'

What do you see instead?

u'2011-12-05T03:02:27.000Z'

What version of the product are you using? On what operating system?

5.0.1 on OS X (but the "bug" is still present in the SCM repo)

Please provide any additional information below.

Here's the relevant snippet of the RSS feed:

<pubDate>Sat, 03 Dec 2011 08:23:57 
+0000</pubDate><atom:updated>2011-12-05T06:50:26.000Z</atom:updated>

This bug happens for all YouTube feeds - they contain different values in 
pubDate and atom:updated, and because atom:updated comes after pubDate, it 
overwrites the date information in feedparser's internal representation.

What is required is a way to access pubDate (maybe via "published" in addition 
to "updated") from a feedparser entry object, even when atom:updated is present.

Replacing "_start_pubdate = _start_updated" with "_start_pubdate = 
_start_published" (and similarly for _end_pubdate) works, but obviously this 
breaks the assumption that pubDate's data will land in "updated".

Original issue reported on code.google.com by th.perl@gmail.com on 5 Dec 2011 at 8:40

GoogleCodeExporter commented 9 years ago
Related bug in gPodder: https://bugs.gpodder.org/show_bug.cgi?id=1492

Original comment by th.perl@gmail.com on 5 Dec 2011 at 8:40

GoogleCodeExporter commented 9 years ago
Wouldn't it make more sense to have <pubDate> map to `published`?  I could see 
using <pubDate> to also populate `updated` - if no other data element was 
available - but in this case it seems like it should grab it from 
<atom:updated>.  Currently it doesn't seem to be possible to reliably get the 
"entry creation" date (unless it happens to be the same as the "entry updated" 
date).

Original comment by josh.ric...@gmail.com on 5 Dec 2011 at 5:30

GoogleCodeExporter commented 9 years ago
Fixed in r663.

Original comment by kurtmckee on 5 Dec 2011 at 7:42