Invalid dates in patchbomb messages (was: Re: [PATCH 0 of 1] py2exe patch updated)

Jan Hudec bulb at ucw.cz
Sat Sep 10 10:45:40 CDT 2005


On Fri, Sep 09, 2005 at 17:09:42 +0200, Volker Kleinfeld wrote:
> > > On the mail-list-archive the dates are ok, I also 
> > > checked the mail headers
> > > of my mails comming back from the mail-list and I did not see something
> > > strange (... on the other hand I am not a perfect mail-header-parser).
> 
> > I suspect the list archives automatically clean up bogus dates by using 
> > the date received if the date sent is invalid. Here's the actual header 
> > I got in one of your patchbomb messages:
> >
> >  Date: Sun,  Sep 2005  (MEZ) - Mitteleurop. Sommerzeit
> >
> >I'm no expert, but that doesn't look valid to me. Your non-patchbomb 
> >message has this, which works fine in Thunderbird:
> >
> >  Date: Fri, 9 Sep 2005 10:26:55 +0200 (MEST)
> 
> The problems seems in the format string of strftime in patchbomb.py
> it uses %e and %T, which is ignored on windows. Looking at my
> python documentation those format strings are not even mentioned.

So replace them with what python time module documentation suggests:

>>> from time import gmtime, strftime
>>> strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())
'Thu, 28 Jun 2001 14:17:15 +0000'

(note, that you have to use gmtime, because there is no portable way to get
the numeric timezone (there is %z in GNU libc, but it is an extension added
for exactly this reason)

--
						 Jan 'Bulb' Hudec <bulb at ucw.cz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.selenic.com/pipermail/mercurial/attachments/20050910/6cb6d48b/attachment.pgp


More information about the Mercurial mailing list