]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-70278: Fix PyUnicode_FromFormat() with precision for %s and %V (GH-120365)
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 24 Jun 2024 15:07:07 +0000 (18:07 +0300)
committerGitHub <noreply@github.com>
Mon, 24 Jun 2024 15:07:07 +0000 (18:07 +0300)
commit6eb23b1311e7eebf2459076703460ee7f8044f05
treea125eacbb2e6e8f14ed25e719b1107da9f92d527
parent22b8a35d6e6660cf7457ed6636cb8c12fff7e8e7
gh-70278: Fix PyUnicode_FromFormat() with precision for %s and %V (GH-120365)

PyUnicode_FromFormat() no longer produces the ending \ufffd
character for truncated C string when use precision with %s and %V.
It now truncates the string before the start of truncated multibyte sequences.
Lib/test/test_capi/test_unicode.py
Misc/NEWS.d/next/C API/2024-06-11-21-38-32.gh-issue-70278.WDE4zM.rst [new file with mode: 0644]
Objects/unicodeobject.c