Skip to content

gh-152470: Make wide-character curses functions work on a narrow build#152476

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:curses-wide-on-narrow
Jun 28, 2026
Merged

gh-152470: Make wide-character curses functions work on a narrow build#152476
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:curses-wide-on-narrow

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

The wide-character curses functions and methods curses.window.get_wch, curses.window.get_wstr, curses.unget_wch, curses.erasewchar, curses.killwchar and curses.wunctrl now also work when Python is built against a non-wide curses library (ncurses, not ncursesw), on an 8-bit locale, where each character is a single byte in the relevant encoding.

curses.ungetch now also accepts a one-character string, like curses.unget_wch; on a wide-character build it can be any character (previously a multibyte character raised OverflowError).

This completes the build-transparent cell API added in gh-151757 and gh-152233.

🤖 Generated with Claude Code

…w build

curses.window.get_wch, curses.window.get_wstr, curses.unget_wch,
curses.erasewchar, curses.killwchar and curses.wunctrl now also work when
Python is built against a non-wide curses library, on an 8-bit locale, where
each character is a single byte in the relevant encoding.  curses.ungetch now
also accepts a one-character string, like curses.unget_wch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33342213 | 📁 Comparing 0a0778c against main (95bfaff)

  🔍 Preview build  

3 files changed
± library/curses.html
± whatsnew/3.16.html
± whatsnew/changelog.html

@serhiy-storchaka serhiy-storchaka merged commit 286b512 into python:main Jun 28, 2026
55 of 56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant