[Zope-dev] Re: Weird test failures with DateTime

Philipp von Weitershausen philipp at weitershausen.de
Sun Nov 27 10:40:36 EST 2005


Philipp von Weitershausen wrote:
> I've recently been seeing weird DateTime test failures on all Zope 2
> branches since 2.7 (see below). Any idea what I'm doing wrong? My system
> is OSX 10.3 with a self-compiled Python 2.4.1 (through darwinports). My
> system timezone, as you can see, is GMT+0800 (Beijing time).

I've figured this one out. The Chinese time zone is known as 'CST', but
so is 'US/Central' as well. In fact, Mac OS X itself doesn't report the
time zones to python consistently. When I set my time zone to Chicago
time, time.tzname is ('CST', 'CST') and when I set my time zone to
Shanghai time, it remains the same, even though it's a completely
different time zone. DateTime.DateTimeZone._zmap can only pick one
timezone to be mapped to the 'CST' name and it happens to choose
'US/Central' (which doesn't surprise me obviously). Running the tests
with the operating system's time zone set to, say, CET works fine.

Philipp



More information about the Zope-Dev mailing list