Message236993
We still have the following in Lib/test/test_time.py:
# Issue #13312: it may return wrong value for year < TIME_MINYEAR + 1900
# Skip the value test, but check that no error is raised
self.yearstr(TIME_MINYEAR)
I reviewed the current time.asctime() code and it does look like it invokes undefined behavior for extremely large negative years.
The problem is that in C struct tm, year is stored as year - 1900 and for year < -2147481748 (= -2**31 + 1900) we trigger an overflow of a signed integer.
Can someone confirm that on AMD64 FreeBSD subtracting 1900 from -2147483648 and then adding it back does not give -2147483648? |
|
Date |
User |
Action |
Args |
2015-03-01 22:30:58 | belopolsky | set | recipients:
+ belopolsky, flox, BreamoreBoy, python-dev |
2015-03-01 22:30:58 | belopolsky | set | messageid: <1425249058.26.0.276403152484.issue13312@psf.upfronthosting.co.za> |
2015-03-01 22:30:58 | belopolsky | link | issue13312 messages |
2015-03-01 22:30:58 | belopolsky | create | |
|