]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-117534: Add checking for input parameter in iso_to_ymd (GH-117543) (#117689)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 9 Apr 2024 18:17:21 +0000 (20:17 +0200)
committerGitHub <noreply@github.com>
Tue, 9 Apr 2024 18:17:21 +0000 (18:17 +0000)
commitaf034dd150ca788ddae107ae5a1f8357f669de9f
treee6c3a71f2482e43a8e3c61dff1303a5891d1e1b0
parent26831278d85761bd33975a7503fbf42b42eae91d
[3.12] gh-117534: Add checking for input parameter in iso_to_ymd (GH-117543) (#117689)

gh-117534: Add checking for input parameter in iso_to_ymd (GH-117543)

Moves the validation for invalid years in the C implementation of the `datetime` module into a common location between `fromisoformat` and `fromisocalendar`, which improves the error message and fixes a failed assertion when parsing invalid ISO 8601 years using one of the "ISO weeks" formats.

---------

(cherry picked from commit d5f1139c79525b4e7e4e8ad8c3e5fb831bbc3f28)

Co-authored-by: Vlad4896 <166005126+Vlad4896@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Lib/test/datetimetester.py
Misc/ACKS
Misc/NEWS.d/next/C API/2024-04-08-09-44-29.gh-issue-117534.54ZE_n.rst [new file with mode: 0644]
Modules/_datetimemodule.c