[Zope] DateTime.rfc822() broken under 2.6.0

alan milligan alan_milligan@hotmail.com
Wed, 27 Nov 2002 15:38:23 +0000


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