pytz2007c error

looping kadeko at gmail.com
Tue Mar 6 04:41:59 EST 2007


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 ?




More information about the Python-list mailing list