From 32e0ce49b8e0c4d8319b32b1cb1783d0fa55d02d Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" <68491+gpshead@users.noreply.github.com> Date: Sun, 1 Nov 2026 09:36:25 -0800 Subject: [PATCH] [3.14] gh-159739: Merge the duplicate NEWS entries for the hz tilde fix (GH-161085) 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. (cherry picked from commit b71fadc9169cdc148c43918a189c4494b4df4978) --- .../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.