[Zope3-dev] Re: Daylight savings unittest errors

Barry Pederson bp@barryp.org
Tue, 01 Jul 2003 11:20:10 -0500


Just to followup on this thread I started by asking about my collector issues...

   http://collector.zope.org/Zope3-dev/159
   http://collector.zope.org/Zope3-dev/160

There does seem to be a problem with mktime() in FreeBSD in the US Central 
timezone.  All the details I've dug up so far are at:

   http://www.freebsd.org/cgi/query-pr.cgi?pr=53899

Basically, I've been able to reproduce the problem in Perl and C (ruling out 
a Python-specific problem), and have found exactly where in the historical 
DST timezone information the info for USCentral seems to be triggering bogus 
results.   Haven't figured out what the bug in the C code is yet - but I'm at 
least convinced I haven't totally lost my mind yet :)

As a workaround, FreeBSD users in the Central zone could probably select 
Canadian/Central time, which seems similar enough to give the correct results 
but doesn't have the historical baggage US/Central does.

However, having seen the dark underside of all the nasty C code underlying 
mktime() and all the variables involved, I believe you'd be better off 
avoiding it and making use of the the pure-Python implementation of 
calendar.timegm() as I proposed as patches in the above collector items. 
That should guarantee consistent results on all platforms and in all 
locations of the world.

	Barry