pytz2007c error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • looping

    #1

    pytz2007c error

    Hi,
    Why this error ?
    >>from pytz import timezone
    >>eastern = timezone('US/Eastern')
    Traceback (most recent call last):
    File "<interacti ve input>", line 1, in <module>
    File "C:\Python25\li b\site-packages\pytz-2007c-py2.5.egg\pytz
    \__init__.py", line 93, in timezone
    File "C:\Python25\li b\site-packages\pytz-2007c-py2.5.egg\pytz
    \tzfile.py", line 33, in build_tzinfo
    for trans in data[:timecnt]]
    File "C:\Python25\li b\site-packages\pytz-2007c-py2.5.egg\pytz
    \tzinfo.py", line 27, in memorized_datet ime
    dt = datetime.utcfro mtimestamp(seco nds)
    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('Europ e/Zurich'),
    timezone('Europ e/Amsterdam'), ...) except a few one:
    >>print timezone('UTC')
    UTC

    Is this a pytz problem or something I didn't understand ?

  • looping

    #2
    Re: pytz2007c error

    On Mar 6, 9:51 am, "looping" <kad...@gmail.c omwrote:
    Hi,
    Why this error ?
    >
    >from pytz import timezone
    >eastern = timezone('US/Eastern')
    >
    Traceback (most recent call last):
    File "<interacti ve input>", line 1, in <module>
    File "C:\Python25\li b\site-packages\pytz-2007c-py2.5.egg\pytz
    \__init__.py", line 93, in timezone
    File "C:\Python25\li b\site-packages\pytz-2007c-py2.5.egg\pytz
    \tzfile.py", line 33, in build_tzinfo
    for trans in data[:timecnt]]
    File "C:\Python25\li b\site-packages\pytz-2007c-py2.5.egg\pytz
    \tzinfo.py", line 27, in memorized_datet ime
    dt = datetime.utcfro mtimestamp(seco nds)
    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('Europ e/Zurich'),
    timezone('Europ e/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.utcfro mtimestamp that doesn't support
    negative value.
    pytz try to pass -1633280400 to this function.

    Is this a problem from Windows ?

    Comment

    • Gabriel Genellina

      #3
      Re: pytz2007c error

      En Tue, 06 Mar 2007 06:41:59 -0300, looping <kadeko@gmail.c omescribió:
      On Mar 6, 9:51 am, "looping" <kad...@gmail.c omwrote:
      >>
      >>from pytz import timezone
      >>eastern = timezone('US/Eastern')
      >>
      >I'm running python 2.5 on WinXP French with the egg from CheeseShop.
      >>
      >Same error with all timezone (like timezone('Europ e/Zurich'),
      >timezone('Euro pe/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.utcfro mtimestamp that doesn't support
      negative value.
      pytz try to pass -1633280400 to this function.
      >
      Is this a problem from Windows ?
      Perhaps it's a problem in pytz trying to go too far in the past...
      -1633280400 refers to a date around 1919.

      --
      Gabriel Genellina

      Comment

      • Stuart Bishop

        #4
        Re: pytz2007c error

        looping wrote:
        On Mar 6, 9:51 am, "looping" <kad...@gmail.c omwrote:
        >Hi,
        >Why this error ?
        >>
        >>>>from pytz import timezone
        >>>>eastern = timezone('US/Eastern')
        >Traceback (most recent call last):
        > File "<interacti ve input>", line 1, in <module>
        > File "C:\Python25\li b\site-packages\pytz-2007c-py2.5.egg\pytz
        >\__init__.py ", line 93, in timezone
        > File "C:\Python25\li b\site-packages\pytz-2007c-py2.5.egg\pytz
        >\tzfile.py", line 33, in build_tzinfo
        > for trans in data[:timecnt]]
        > File "C:\Python25\li b\site-packages\pytz-2007c-py2.5.egg\pytz
        >\tzinfo.py", line 27, in memorized_datet ime
        > dt = datetime.utcfro mtimestamp(seco nds)
        >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('Europ e/Zurich'),
        >timezone('Euro pe/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.utcfro mtimestamp 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.



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

        --
        Stuart Bishop <stuart@stuartb ishop.net>



        -----BEGIN PGP SIGNATURE-----
        Version: GnuPG v1.4.3 (GNU/Linux)

        iD8DBQFF7WKxAfq Zj7rGN0oRAt8uAK CZ+VlXBXoFMoOUo 8CPjUpEYWs2rQCf Z0Rg
        CT63WeikMGEURtd uMdQ/m3Q=
        =yY/3
        -----END PGP SIGNATURE-----

        Comment

        Working...