You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
curses window.encoding does not encode str arguments on a wide build #156347
The curses HOWTO says that strings passed to window.addstr() are "encoded to bytes using the value of the window's encoding attribute", and the window.encoding entry in the library reference describes it as the "Encoding used to encode method arguments (Unicode strings and characters)". On a build linked against a wide-character version of the curses library, which is what CPython configures by default, neither is true: PyCurses_ConvertToString in Modules/_cursesmodule.c converts str with PyUnicode_AsWideCharString and never reads win->encoding, so the bytes that reach the terminal come from the current locale instead.
Activity
serhiy-storchaka commentedon Aug 25, 2026
There are many other wrong statements in the curses HOWTO. #156354 fixes them and slightly modernizes the documentation.
fedonman commentedon Aug 25, 2026
@serhiy-storchaka I had already opened #156352 Should I close it?
serhiy-storchaka commentedon Aug 27, 2026
Yes, I think it is superseded by #156354.
gh-156347: Fix wrong statements in the curses documentation (GH-156354)
[3.14] gh-156347: Fix wrong statements in the curses documentation (G…
[3.13] gh-156347: Fix wrong statements in the curses documentation (G…
[3.15] gh-156347: Fix wrong statements in the curses documentation (G…
pythongh-156347: Fix wrong statements in the curses documentation (py…