rfc822 module bug?

Nemesis nemesis at nowhere.invalid
Sat Jul 30 11:08:39 CEST 2005


Hi all,
I found that the function parsedate_tz of the rfc822 module has a bug
(or at least I think so).
I found a usenet article (message-id: <2714d.q75200 at myg.winews.net>)
that has this Date field:

Date: Tue,26 Jul 2005 13:14:27 GMT +0200

It seems to be correct¹, but parsedate_tz is not able to decode it, it
is confused by the absence of a space after the ",".
I studied the parsedate_tz code and the problem is on its third line:
...
    if not data:
        return None
    data = data.split()
...
After the split I have:

['Tue,26', 'Jul', '2005', '13:14:27', 'GMT', '+0200']

but "Tue," and "26" should be separated.

Of course parsedate_tz correctly decode the field if you add a space
after the ",".

Do you think that's a bug?
Which is the most correct place where to file this bug?


¹ and looking at rfc822 par3.3 it should be correct:

date-time       =       [ day-of-week "," ] date FWS time [CFWS]

day-of-week     =       ([FWS] day-name) / obs-day-of-week

day-name        =       "Mon" / "Tue" / "Wed" / "Thu" /
                        "Fri" / "Sat" / "Sun"

date            =       day month year

-- 
A pat on the back is only a few centimeters from a kick in the butt.
 
 |\ |       |HomePage   : http://nem01.altervista.org
 | \|emesis |XPN (my nr): http://xpn.altervista.org




More information about the Python-list mailing list