[issue40771] python3 fromtimestamp generates OSError

SilentGhost report at bugs.python.org
Mon May 25 14:18:28 EDT 2020


SilentGhost <ghost.adh at runbox.com> added the comment:

You seem to have read the docs, so I'm a bit confused why you think that is a bug. According to https://docs.python.org/3/library/datetime.html#datetime.datetime.fromtimestamp

> fromtimestamp() may raise OverflowError, if the timestamp is out of the range of values supported by the platform C localtime() or gmtime() functions, and OSError on localtime() or gmtime() failure.

This looks exactly like this type of error. It is completely irrelevant whether Windows supports a timestamp this far in the future, clearly platform's localtime() / gmtime() do not. Constructing datetime object in Python does not require such system calls and their limitations no longer apply.

----------
nosy: +SilentGhost, belopolsky, p-ganssle
type:  -> behavior

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


More information about the Python-bugs-list mailing list