dimones / feedparser

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

dates are not correctly parsed #338

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

url = "http://ep00.epimg.net/rss/tags/noticias_mas_vistas.xml"
feed = feedparser.parse(url)
print feed.entries[0].published
print feed.entries[0].published_parsed

What is the expected output? What do you see instead?

Obtained output:
Mon, 2 Apr 2012 20:57:14 +0200
None

Desired output:
Mon, 2 Apr 2012 20:57:14 +0200
datetime.datetime(2012, 4, 2, 20, 57, 14, tzinfo=tzoffset(None, 7200))

What version of the product are you using? On what operating system?
Latest feedparser available. OS is Linux CentOS 5.

Please provide any additional information below.

I think the issue is related to the date string being unicode. I managed to 
code a workaround for this:

import dateutil.parser
import feedparser

url = "http://ep00.epimg.net/rss/tags/noticias_mas_vistas.xml"
feed = feedparser.parse(url)
print feed.entries[0].published
print dateutil.parser.parse(feed.entries[0].published)

Original issue reported on code.google.com by ignacior...@gmail.com on 3 Apr 2012 at 11:54

GoogleCodeExporter commented 9 years ago
This is now fixed in r695. Thanks for reporting this!

Original comment by kurtmckee on 5 Apr 2012 at 4:13