-
-
Notifications
You must be signed in to change notification settings - Fork 32.9k
Closed
Closed
Copy link
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
import _datetime, _pydatetime
_datetime.date(1, 1, 50)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: day is out of range for month```
_pydatetime.date(1, 1, 50)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.12/_pydatetime.py", line 960, in __new__
year, month, day = _check_date_fields(year, month, day)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/_pydatetime.py", line 535, in _check_date_fields
raise ValueError('day must be in 1..%d' % dim, day)
ValueError: ('day must be in 1..31', 50)
The error message differs between the two implementations of datetime. This came up when testing PyPy, which uses the pure-python datetime implementation. xref conda-forge/rtoml-feedstock#1 (comment)
CPython versions tested on:
3.12
Operating systems tested on:
Linux
Linked PRs
Metadata
Metadata
Assignees
Labels
3.12only security fixesonly security fixes3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesextension-modulesC modules in the Modules dirC modules in the Modules dirstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
Done