looping wrote:
On Mar 6, 9:51 am, "looping" <[EMAIL PROTECTED]> 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/90096Current workaround is to use an earlier release. This will be fixed as pytz needs to remain cross platform.
-- Stuart Bishop <[EMAIL PROTECTED]> http://www.stuartbishop.net/
signature.asc
Description: OpenPGP digital signature
-- http://mail.python.org/mailman/listinfo/python-list