From 68f0d61c886d364063a21063d1d1e1d1933a06d9 Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Sun, 1 Nov 2026 17:25:20 +0000 Subject: [PATCH] gh-159739: Merge the duplicate NEWS entries for the hz tilde fix GH-160400 and GH-160519 fixed the same hz encoder bug and each added a NEWS entry for it. Keep one, in the gh-159739 entry. --- .../2026-10-22-08-15-57.gh-issue-160518.hZt1Ld.rst | 3 --- .../2026-10-22-16-23-01.gh-issue-159739.CjkR5a.rst | 10 ++++++---- 2 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 Misc/NEWS.d/next/Library/2026-10-22-08-15-57.gh-issue-160518.hZt1Ld.rst diff --git a/Misc/NEWS.d/next/Library/2026-10-22-08-15-57.gh-issue-160518.hZt1Ld.rst b/Misc/NEWS.d/next/Library/2026-10-22-08-15-57.gh-issue-160518.hZt1Ld.rst deleted file mode 100644 index 3a3c6805ec82ae..00000000000000 --- a/Misc/NEWS.d/next/Library/2026-10-22-08-15-57.gh-issue-160518.hZt1Ld.rst +++ /dev/null @@ -1,3 +0,0 @@ -Fix the ``hz`` codec sometimes encoding ``~`` as a single ``~`` instead of -``~~`` in text that mixes ASCII and Chinese characters, which produced data -that did not decode back to the original text. diff --git a/Misc/NEWS.d/next/Library/2026-10-22-16-23-01.gh-issue-159739.CjkR5a.rst b/Misc/NEWS.d/next/Library/2026-10-22-16-23-01.gh-issue-159739.CjkR5a.rst index 2860dc6897ecc0..78a3ecc46247c4 100644 --- a/Misc/NEWS.d/next/Library/2026-10-22-16-23-01.gh-issue-159739.CjkR5a.rst +++ b/Misc/NEWS.d/next/Library/2026-10-22-16-23-01.gh-issue-159739.CjkR5a.rst @@ -1,4 +1,6 @@ -Fix HZ encoding of a tilde at an output buffer boundary and ISO-2022 decoding -of split escape sequences. Reset ISO-2022 incremental codecs to their initial -state. Keep multibyte codec tables and custom encoder error policies alive -when Python code replaces them during use. +Fix the ``hz`` codec sometimes encoding ``~`` as a single ``~`` in text that +mixes ASCII and Chinese characters, and the incremental ``iso2022_*`` codecs +mishandling an escape sequence split across calls or keeping the previous +character set after :meth:`!reset`. Also fix possible crashes in the CJK +incremental and stream codecs when their ``errors`` attribute or their class's +``codec`` attribute is replaced while they are in use.