]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-152503: Fix garbage text from curses wide-character cell reads (GH-152505)
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 29 Jun 2026 12:06:47 +0000 (15:06 +0300)
committerGitHub <noreply@github.com>
Mon, 29 Jun 2026 12:06:47 +0000 (12:06 +0000)
commite7b21b66a4ddc0ed57f74972bfb7cf1b678fca0a
treed7315649854a7a2165951d469dd1db5d2b16794c
parent0635e55b47e306aa6cc0610105775849b0699e2c
gh-152503: Fix garbage text from curses wide-character cell reads (GH-152505)

window.in_wch(), window.in_wchstr() and window.getbkgrnd() read a cell
into an uninitialized cchar_t, relying on the curses library to leave the
text NUL-terminated -- which ncurses does but X/Open does not require, so
some libraries (such as NetBSD curses) returned uninitialized bytes as
wide characters.  Zero-initialize the cell buffers before the read and
default the getcchar() output to an empty string.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Misc/NEWS.d/next/Library/2026-06-28-16-20-07.gh-issue-152503.N55ose.rst [new file with mode: 0644]
Modules/_cursesmodule.c