]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.13] gh-153864: Fix curses window.insch() for non-ASCII characters on a wide build...
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 19 Jul 2026 15:17:14 +0000 (18:17 +0300)
committerGitHub <noreply@github.com>
Sun, 19 Jul 2026 15:17:14 +0000 (15:17 +0000)
commitfb9a98ab0089c0340168f62a70cfbe2945fba494
treeaa99a6acbf9889a305aac98cbfd2fdbffe8ec712
parent9e12f3b4adf306b922b1da4763a22e229e2d3a3c
[3.13] gh-153864: Fix curses window.insch() for non-ASCII characters on a wide build (GH-153865) (GH-154154)

On a wide build, winsch() does not locale-decode a byte above 127, unlike
waddch(), so insch()/mvinsch() stored the wrong character for a non-ASCII
byte of an 8-bit locale ('€' 0xA4 under ISO-8859-15 became U+00A4 '¤').
Decode the byte with btowc() and insert it as a wide character, as addch()
effectively does.

(cherry picked from commit 223cbffca6df7e4c8c77b360a4e6ba0472255643)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Lib/test/test_curses.py
Misc/NEWS.d/next/Library/2026-07-17-20-56-32.gh-issue-153864.WmA9By.rst [new file with mode: 0644]
Modules/_cursesmodule.c