DateTime.rfc822() broken under 2.6.0
Hi, I've just discovered that the rfc822 function throws an exception under 2.6.0. On further investigation, the problem is that there are references to two global variables, localzone, and altzone which are not set. The only place where these are referenced within the class is a global f'n, _findLocalTimeZoneName, but then they have local lexical scope at this point ... I don't really understand the significance of all of this, but the following is a grubby hack to get things working (if someone would let me know, I can bundle these things as patches...) def rfc822(self): """Return the date in RFC 822 format""" # # WAM theres a problem with the defns on localzone/altzone ... # localzone = altzone = 0 _findLocalTimeZoneName(1) if self._tz == self._localzone0: #Use local standard time tzoffset = _tzoffset2rfc822zone(localzone) elif self._tz == self._localzone1: # Use local daylight saving time tzoffset = _tzoffset2rfc822zone(altzone) else: tzoffset = '-0000' # unknown time zone offset return '%s, %2.2d %s %d %2.2d:%2.2d:%2.2d %s' % ( self._aday,self._day,self._amon,self._year, self._hour,self._minute,self._nearsec,tzoffset) I look forward to a proper fix. Cheers, Alan _________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail
alan milligan wrote:
Hi,
I've just discovered that the rfc822 function throws an exception under 2.6.0.
Yes, it's mentioned in the collector (if you can find it -- If only knew how to query by version) and there's a fix in http://www.zope.org/Members/regebro/datetime_260_fix Pity it isn't mentioned on the zope 2.6.0 download page..... -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007
participants (2)
-
alan milligan -
Luca Olivetti