]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-102450: Add ISO-8601 alternative for midnight to `fromisoformat()` calls. (#105856)
authorTizzySaurus <47674925+TizzySaurus@users.noreply.github.com>
Wed, 25 Sep 2024 21:32:51 +0000 (22:32 +0100)
committerGitHub <noreply@github.com>
Wed, 25 Sep 2024 21:32:51 +0000 (14:32 -0700)
commitb0c6cf5f17f0be13aa927cf141a289f7b76ae6b1
tree1d15a8c4aff1177c6ef6ae56d617ff63f6ecd801
parent68e384c2179fba41bc3be469e6ef34927a37f4a5
gh-102450: Add ISO-8601 alternative for midnight to `fromisoformat()` calls. (#105856)

* Add NEWS.d entry

* Allow ISO-8601 24:00 alternative to midnight on datetime.time.fromisoformat()

* Allow ISO-8601 24:00 alternative to midnight on datetime.datetime.fromisoformat()

* Add NEWS.d entry

* Improve error message when hour is 24 and minute/second/microsecond is not 0

* Add tests for 24:00 fromisoformat

* Remove duplicate call to days_in_month() by storing in variable

* Add Python implementation

* Fix Lint

* Fix differing error msg in datetime.fromisoformat implementations when 24hrs has non-zero time component(s)

* Fix using time components inside tzinfo in Python implementation

* Don't parse tzinfo in C implementation when invalid iso midnight

* Remove duplicated variable in datetime test assertion line

* Add self to acknowledgements

* Remove duplicate NEWS entry

* Linting

* Add missing test case for when wrapping the year makes it invalid (too large)
Lib/_pydatetime.py
Lib/test/datetimetester.py
Misc/ACKS
Misc/NEWS.d/next/Library/2023-06-16-14-52-00.gh-issue-102450.MfeR6A.rst [new file with mode: 0644]
Modules/_datetimemodule.c