]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-52551: Fix encoding issues in strftime() (GH-125193) (GH-125657)
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 17 Oct 2024 19:48:34 +0000 (22:48 +0300)
committerGitHub <noreply@github.com>
Thu, 17 Oct 2024 19:48:34 +0000 (22:48 +0300)
commit08ccbb9b3f5e20a7a0c4cf9995e172b59fb6067b
tree717d88e062d9d795b8072630fa5e643e04c96fed
parentd894d467a615ada8150e9e6987f1969f0a5e2cd9
[3.13] gh-52551: Fix encoding issues in strftime() (GH-125193) (GH-125657)

Fix time.strftime(), the strftime() method and formatting of the
datetime classes datetime, date and time.

* Characters not encodable in the current locale are now acceptable in
  the format string.
* Surrogate pairs and sequence of surrogatescape-encoded bytes are no
  longer recombinated.
* Embedded null character no longer terminates the format string.

This fixes also gh-78662 and gh-124531.

(cherry picked from commit ad3eac1963a5f195ef9b2c1dbb5e44fa3cce4c72)
Lib/test/datetimetester.py
Lib/test/test_time.py
Misc/NEWS.d/next/Library/2024-10-09-17-07-33.gh-issue-52551.PBakSY.rst [new file with mode: 0644]
Modules/_datetimemodule.c
Modules/timemodule.c