From d3ae17b30e9800fa2dfc376900f5ca252f0c2d01 Mon Sep 17 00:00:00 2001 From: Jan Kaliszewski Date: Mon, 30 Sep 2024 04:50:07 +0200 Subject: [PATCH] Add the blurb --- .../2024-09-30-04-49-22.gh-issue-124529.hDDlMH.rst | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2024-09-30-04-49-22.gh-issue-124529.hDDlMH.rst diff --git a/Misc/NEWS.d/next/Library/2024-09-30-04-49-22.gh-issue-124529.hDDlMH.rst b/Misc/NEWS.d/next/Library/2024-09-30-04-49-22.gh-issue-124529.hDDlMH.rst new file mode 100644 index 000000000000000..50261019e69c0c4 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-09-30-04-49-22.gh-issue-124529.hDDlMH.rst @@ -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``).