pytz2007c error

Stuart Bishop stuart at stuartbishop.net
Tue Mar 6 13:46:41 CET 2007


looping wrote:
> On Mar 6, 9:51 am, "looping" <kad... at gmail.com> wrote:
>> Hi,
>> Why this error ?
>>
>>>>> from pytz import timezone
>>>>> eastern = timezone('US/Eastern')
>> Traceback (most recent call last):
>>   File "<interactive input>", line 1, in <module>
>>   File "C:\Python25\lib\site-packages\pytz-2007c-py2.5.egg\pytz
>> \__init__.py", line 93, in timezone
>>   File "C:\Python25\lib\site-packages\pytz-2007c-py2.5.egg\pytz
>> \tzfile.py", line 33, in build_tzinfo
>>     for trans in data[:timecnt]]
>>   File "C:\Python25\lib\site-packages\pytz-2007c-py2.5.egg\pytz
>> \tzinfo.py", line 27, in memorized_datetime
>>     dt = datetime.utcfromtimestamp(seconds)
>> ValueError: timestamp out of range for platform localtime()/gmtime()
>> function
>>
>> I'm running python 2.5 on WinXP French with the egg from CheeseShop.
>>
>> Same error with all timezone (like timezone('Europe/Zurich'),
>> timezone('Europe/Amsterdam'), ...) except a few one:>>> print timezone('UTC')
>>
>> UTC
>>
>> Is this a pytz problem or something I didn't understand ?
> 
> OK, the error come from datetime.utcfromtimestamp that doesn't support
> negative value.
> pytz try to pass -1633280400 to this function.
> 
> Is this a problem from Windows ?

Looks like it. I've opened a bug.

https://bugs.beta.launchpad.net/pytz/+bug/90096

Current workaround is to use an earlier release. This will be fixed as pytz 
needs to remain cross platform.

-- 
Stuart Bishop <stuart at stuartbishop.net>
http://www.stuartbishop.net/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20070306/11197335/attachment.sig>


More information about the Python-list mailing list