[issue29921] datetime validation is stricter in 3.6.1 than previous versions

STINNER Victor report at bugs.python.org
Mon Mar 27 16:55:25 EDT 2017


STINNER Victor added the comment:

> The change in issue #29100 - intended AFAICS simply to fix a regression in 3.6 - seems to have made datetime validation via certain code paths stricter than it was in 2.7 or 3.5.

What do you mean by "stricter than 2.7 & 3.5"? The year 30828 was never valid.

Python 2.7 and 3.5:

>>> datetime.datetime(30828, 1, 1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: year is out of range
>>> datetime.datetime.fromtimestamp(2**37)
datetime.datetime(6325, 4, 8, 17, 4, 32)
>>> datetime.datetime.fromtimestamp(2**38)
Traceback (most recent call last):
  ...
ValueError: year is out of range

Python 3.6.1 should only be stricter than Python 3.6.0.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29921>
_______________________________________


More information about the Python-bugs-list mailing list