Commit graph

11 commits

Author SHA1 Message Date
Miss Islington (bot)
8f26a79b33
gh-130959: Reject whitespace in fractions, in pure Python fromisoformat() (GH-130962) (GH-131076) (#131086)
Fix the pure Python implementation of `fromisoformat()` to reject any
non-digit characters, including whitespace, in the fractional part
of time specification.  This makes the behavior consistent with the C
implementation, and prevents incorrect parsing of these fractions
(e.g. `.400 ` would be misinterpreted as `.04`).

(cherry picked from commit 33494b4d0d)
(cherry picked from commit 27fd328cf6)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Michał Górny <mgorny@gentoo.org>
2025-03-11 12:00:06 +00:00
Miss Islington (bot)
06e4173393
[3.12] gh-127553: Remove outdated TODO comment in _pydatetime (GH-127564) (#128501)
(cherry picked from commit e8b6b39ff7)

Co-authored-by: Beomsoo Kim <beoms424@gmail.com>
2025-01-04 22:55:24 +00:00
Serhiy Storchaka
e6878fc3c8
Revert "[3.12] gh-120713: Normalize year with century for datetime.strftime (GH-120820) (GH-121145)" (GH-122409)
This reverts commit 027902b56f.
2024-07-29 21:55:12 +03:00
Serhiy Storchaka
027902b56f
[3.12] gh-120713: Normalize year with century for datetime.strftime (GH-120820) (GH-121145)
(cherry picked from commit 6d34938dc8)

Co-authored-by: blhsing <blhsing@gmail.com>
2024-06-29 06:54:27 +00:00
Miss Islington (bot)
e123f74513
[3.12] gh-120268: Prohibit passing `None to _pydatetime.date.fromtimestamp` (GH-120269) (GH-120283)
This makes the pure Python implementation consistent with the C implementation.
(cherry picked from commit 34f5ae69fe)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-06-11 12:54:20 +03:00
Miss Islington (bot)
2e8417eec4
[3.12] gh-106392: Fix inconsistency in deprecation warnings in datetime module (GH-114761) (#114767)
gh-106392: Fix inconsistency in deprecation warnings in datetime module (GH-114761)
(cherry picked from commit dc4cd2c9ba)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-30 19:24:27 -08:00
Miss Islington (bot)
e5c860f9d0
[3.12] Fix date.__repr__() docstring (GH-109422) (#109448)
Fix date.__repr__() docstring (GH-109422)
(cherry picked from commit 5eec58a9e5)

Co-authored-by: Christopher Yeh <chrisyeh96@users.noreply.github.com>
2023-10-02 16:58:43 +02:00
Miss Islington (bot)
579d782276
[3.12] Docs: Fix typo in datetime.tzinfo docstring (GH-107257) (#109032)
Docs: Fix typo in datetime.tzinfo docstring (GH-107257)
(cherry picked from commit 60a9eea3f5)

Co-authored-by: Mikhail Samylov <Samylov-Mikhail@yandex.com>
Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-09-08 15:11:32 +02:00
Miss Islington (bot)
b862c25922
[3.12] gh-106392: Fix inconsistency in deprecation warnings (GH-106436) (#108792)
gh-106392: Fix inconsistency in deprecation warnings (GH-106436)

They used "datetime" to refer to both the object and the module.
(cherry picked from commit d5c5d4bfd3)

Co-authored-by: William Andrea <william.j.andrea@gmail.com>
2023-09-02 23:44:28 +02:00
Paul Ganssle
0a5cd984b2 GH-84976: Re-introduce datetime.py and fix reprs
Without the change to the reprs, pure-python classes would have a repr
of `datetime._pydatetime.time`, etc.
2023-05-03 03:09:45 -06:00
Paul Ganssle
65c4a2b326 GH-84976: Move Lib/datetime.py to Lib/_pydatetime
This breaks the tests, but we are keeping it as a separate commit so
that the move operation and editing of the moved files are separate, for
a cleaner history.
2023-05-03 03:09:45 -06:00
Renamed from Lib/datetime.py (Browse further)