rfc822 module bug?

Tim Roberts timr at probo.com
Mon Aug 1 07:42:58 CEST 2005


Nemesis <nemesis at nowhere.invalid> wrote:
>
>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 ",".

Fascinating.  I've written a lot of e-mail programs, and I would have bet
real money that this was not legal by either RFC822 or 2822, but the BNF
certainly supports your assertion that this is valid.

RFC1036, which gives the format for Usenet articles, includes the space in
its "suggested" date format.

>¹ 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

This is actually from RFC2822, but the point is the same.
-- 
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list