Message271229
Without blocking the C implementation _datetime, I get both extremes causing OverflowError:
>>> import datetime, time, os
>>> os.environ["TZ"] = "EST+05EDT,M3.2.0,M11.1.0"
>>> time.tzset()
>>> t = datetime.datetime(2,1,1)
>>> s = t.timestamp()
>>> s
-122233584944.0
>>> datetime.datetime.fromtimestamp(s)
OverflowError: timestamp out of range for platform time_t
>>> t = datetime.datetime(9998,12,12)
>>> s = t.timestamp()
>>> s
760175195728.0
>>> datetime.datetime.fromtimestamp(s)
OverflowError: timestamp out of range for platform time_t
When I repeated the test with sys["_datetime"] = None, both t.timestamp() calls raised OverflowError, which I assume is expected. |
|
Date |
User |
Action |
Args |
2016-07-25 04:58:20 | martin.panter | set | recipients:
+ martin.panter, tim.peters, belopolsky, vstinner, stub, akira, python-dev, koobs |
2016-07-25 04:58:20 | martin.panter | set | messageid: <1469422700.84.0.248770822781.issue24773@psf.upfronthosting.co.za> |
2016-07-25 04:58:20 | martin.panter | link | issue24773 messages |
2016-07-25 04:58:20 | martin.panter | create | |
|