-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
9 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
Misc/NEWS.d/next/Library/2024-09-30-04-49-22.gh-issue-124529.hDDlMH.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Fix :meth:`datetime.datetime.strptime`, :meth:`datetime.date.strptime` as | ||
well as :func:`time.strptime` (by modifying :class:`_strptime.TimeRE`) to | ||
make ``%c`` and ``%y`` accept year number representations consisting of | ||
fewer digits than the usual four or two. Thanks to that, certain | ||
``strftime/strptime`` round trips (such as | ||
``datetime.strptime(dt.strftime("%c"), "%c"))`` for ``dt.year`` less than | ||
1000) no longer raise ``ValueError`` for some locales/platforms (this was | ||
the case, e.g., on Linux -- for various locales, including | ||
``C``/``C.UTF-8``). |