google-code-export / feedparser

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

_parse_date() returns None for "Mon, 5 Mar 2012 11:42:30 -0800" #337

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
feedparser version 5.1 or 5.1.1
>>> feedparser._parse_date("Mon, 5 Mar 2012 11:42:30 -0800")
None

What is the expected output? What do you see instead?
_parse_date for version 5.0.1 
>>> feedparser._parse_date("Mon, 5 Mar 2012 11:42:30 -0800")
time.struct_time(tm_year=2012, tm_mon=3, tm_mday=5, tm_hour=19, tm_min=42, 
tm_sec=30, tm_wday=0, tm_yday=65, tm_isdst=0)

What version of the product are you using? On what operating system?
feedparser version 5.1 and 5.1.1 / ubuntu 11.10, Python 2.7.2+

Original issue reported on code.google.com by ownp...@gmail.com on 1 Apr 2012 at 6:10

GoogleCodeExporter commented 9 years ago
To fix the issue 
_rfc822_day = "(?P<day>\d{2})"  
should be changed to 
_rfc822_day = "(?P<day>\d{1,2})"

Original comment by ownp...@gmail.com on 1 Apr 2012 at 7:33

GoogleCodeExporter commented 9 years ago
Most probable that the more correct way is to define 

_rfc822_day = "(?P<day>\s*\d{1,2})"

because of "Fri,  9 Mar 2012 02:25:00 +0400"

Original comment by ownp...@gmail.com on 1 Apr 2012 at 5:05

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r695.

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

GoogleCodeExporter commented 9 years ago
Thanks for reporting this issue!

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

GoogleCodeExporter commented 9 years ago
Issue 338 has been merged into this issue.

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