Message271229
| Author |
martin.panter |
| Recipients |
akira, belopolsky, koobs, martin.panter, python-dev, stub, tim.peters, vstinner |
| Date |
2016年07月25日.04:58:20 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1469422700.84.0.248770822781.issue24773@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|