]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-117534: Add checking for input parameter in iso_to_ymd (#117543)
authorVlad4896 <166005126+Vlad4896@users.noreply.github.com>
Tue, 9 Apr 2024 17:53:00 +0000 (20:53 +0300)
committerGitHub <noreply@github.com>
Tue, 9 Apr 2024 17:53:00 +0000 (13:53 -0400)
commitd5f1139c79525b4e7e4e8ad8c3e5fb831bbc3f28
tree4e47fb05321d1ed1dbf7db415f40d20538b8e78a
parenta25c02eaf01abc7ca79efdbcda986b9cc2787b6c
gh-117534: Add checking for input parameter in iso_to_ymd (#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.

---------

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