[issue44413] OverflowError: mktime argument out of range after 2019

Terry J. Reedy report at bugs.python.org
Wed Dec 15 15:23:00 EST 2021


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Thank you both.  Status: Failures on Open Suse TW (Vyacheslav) and Ubuntu 20-04 (Daniel McDonald, Github Actions, and Azure Pipelines).
Success on Windows (me), macOS (Catalina-me and 11.6.1-DM), Centos 7.9 and Ubuntu 18-04 (both DM) 

I verified that the sample tuple is consistent and round-trips with time.localtime.

>>> import time
>>> time.mktime((2017,5,26,15,30,16,4,146,1))
1495827016.0
>>> time.localtime(time.mktime((2017,5,26,15,30,16,4,146,1)))
time.struct_time(tm_year=2017, tm_mon=5, tm_mday=26, tm_hour=15, tm_min=30, tm_sec=16, tm_wday=4, tm_yday=146, tm_isdst=1)

While OverflowError is documented as a legitimate response, it is not for a contemporary valid datetime such as the above.  Someone with a failure machine could try to determine what tuple vales do and don't result in the error.  Someone with both failure and success machines could add debug prints to mktime (or use C debugger) to see where the behavior of the C code diverges on the two machines.  If no one active on the issue can do either, a request could be made for help on python-list.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44413>
_______________________________________


More information about the Python-bugs-list mailing list