Joris Geysens added the comment:
I looked at this a bit more in detail.
What happens it the following, starting in the datetime fromtimestamp fragment :
converter = _time.gmtime if utc else _time.localtime
y, m, d, hh, mm, ss, weekday, jday, dst = converter(t)
That will call the system
Joris Geysens added the comment:
I see this in the python source code being tested (datetimetester.py), so I
guess it is a rounding problem :
# maximum timestamp: set seconds to zero to avoid rounding issues
max_dt = self.theclass.max.replace(tzinfo=timezone.utc
Joris Geysens added the comment:
a ValueError is raised :
ValueError: year 1 is out of range
on
dt = datetime.fromtimestamp(ts, tz=timezone.utc)
or
dt = datetime.utcfromtimestamp(ts)
--
___
Python tracker
<https://bugs.python.
New submission from Joris Geysens :
Reading the documentation, I don't understand how this is not possible :
# get the max utc timestamp
ts = datetime.max.replace(tzinfo=timezone.utc).timestamp()
# similarly
ts2 = datetime(, 12, 31, 23, 59, 59, 99,
tzinfo=timezone.utc).time