]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-52551: Fix encoding issues in strftime() (GH-125193)
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 17 Oct 2024 15:46:59 +0000 (18:46 +0300)
committerGitHub <noreply@github.com>
Thu, 17 Oct 2024 15:46:59 +0000 (15:46 +0000)
commitad3eac1963a5f195ef9b2c1dbb5e44fa3cce4c72
treec98cc588f9ad2070be389ad5c181d559b8e74bb2
parent0cb20f2e7e867d5c34fc17dd5b8e51e8b0020bb3
gh-52551: Fix encoding issues in strftime() (GH-125193)

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.
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