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.

classification
Title: OverflowError: mktime argument out of range
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.7
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: belopolsky, darkman66, eric.smith, iritkatriel, p-ganssle
Priority: normal Keywords:

Created on 2020-04-21 21:42 by darkman66, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg366944 - (view) Author: (darkman66) Date: 2020-04-21 21:42
example test

import time, pickle

d=pickle.loads(b'\x80\x03ctime\nstruct_time\nq\x00(M\xe4\x07K\x04K\x10K\x13K\x0cK#K\x03KkK\x01tq\x01}q\x02(X\x07\x00\x00\x00tm_zoneq\x03NX\t\x00\x00\x00tm_gmtoffq\x04Nu\x86q\x05Rq\x06.')
time.mktime(d)

on macox python compiled via brew 
Python 3.7.3 (default, Mar  6 2020, 22:34:30)
Type "copyright", "credits" or "license" for more information.

IPython 5.3.0 -- An enhanced Interactive Python.

all good, result -> Out[3]: 1587064355.0

in docker installed out of official deb (ubuntu 9.10)

Python 3.7.5 (default, Nov 20 2019, 09:21:52)
Type "copyright", "credits" or "license" for more information.
IPython 5.3.0 -- An enhanced Interactive Python.


In [5]: time.mktime(d)
---------------------------------------------------------------------------
OverflowError                             Traceback (most recent call last)
<ipython-input-5-b475bfddba64> in <module>()
----> 1 time.mktime(d)

OverflowError: mktime argument out of range
msg366954 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2020-04-21 23:24
FWIW, that time.struct_time value is:

>>> d
time.struct_time(tm_year=2020, tm_mon=4, tm_mday=16, tm_hour=19, tm_min=12, tm_sec=35, tm_wday=3, tm_yday=107, tm_isdst=1)


I don't get an error on 3.7.4 from Cygwin or 3.7.6 from stock Fedora.
msg411432 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2022-01-24 00:15
3.7 is no longer maintained. I was unable to reproduce this on 3.11 on windows or Mac.  Please create a new issue if you are still seeing this on a current version.
History
Date User Action Args
2022-04-11 14:59:29adminsetgithub: 84536
2022-01-24 00:15:38iritkatrielsetstatus: open -> closed

nosy: + iritkatriel
messages: + msg411432

resolution: works for me
stage: resolved
2020-04-22 12:56:42xtreaksetnosy: + belopolsky, p-ganssle
2020-04-21 23:24:55eric.smithsetnosy: + eric.smith
messages: + msg366954

components: + Interpreter Core, - C API
type: crash -> behavior
2020-04-21 21:42:23darkman66create