]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.15] gh-153862: Fix curses window.inch() for non-ASCII characters on a wide build...
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 19 Jul 2026 12:46:08 +0000 (15:46 +0300)
committerGitHub <noreply@github.com>
Sun, 19 Jul 2026 12:46:08 +0000 (12:46 +0000)
commit7d1b64bd9a07deb4ce20e0f3d1b07b0507c51431
tree7ff53fdc3303c2678dd806f768b77ae45ab56ede
parent46d7aa9fbd2fafb099da6a61f3865620d4dc9125
[3.15] gh-153862: Fix curses window.inch() for non-ASCII characters on a wide build (GH-153863) (GH-154116)

On a wide build, winch() returns the low 8 bits of the character's code
point with no locale conversion, so inch()/mvinch() disagreed with instr()
for a non-ASCII character of an 8-bit locale ('€' under ISO-8859-15 gave
0xAC instead of 0xA4).  Re-encode the cell to its locale byte via wctob(),
as ncurses does for getbkgd().

(cherry picked from commit a83aaa91490d5885949eb0780a37b15963b6d0f3)

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Doc/library/curses.rst
Lib/test/test_curses.py
Misc/NEWS.d/next/Library/2026-07-17-20-31-00.gh-issue-153862.X3kjoY.rst [new file with mode: 0644]
Modules/_cursesmodule.c