This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients BreamoreBoy, belopolsky, flox, python-dev
Date 2015-03-01.22:30:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
We still have the following in Lib/test/

        # Issue #13312: it may return wrong value for year < TIME_MINYEAR + 1900
        # Skip the value test, but check that no error is raised

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:58belopolskysetrecipients: + belopolsky, flox, BreamoreBoy, python-dev
2015-03-01 22:30:58belopolskysetmessageid: <>
2015-03-01 22:30:58belopolskylinkissue13312 messages
2015-03-01 22:30:58belopolskycreate