Skip to content

Restore ncurses widechar support on macOS #111460

Closed
@sorcio

Description

@sorcio

Bug report

Bug description:

Python 3.12 dropped ncurses wide char support on macOS, so for example curses.get_wch() is not available anymore.

I believe this was an unintended consequence of #94452, because the change is not documented anywhere. After that PR, HAVE_NCURSESW is never defined on Darwin. It looks like this bit of logic was not ported from setup.py to configure.ac:

cpython/setup.py

Lines 1121 to 1124 in ec5e253

elif MACOS and curses_library == 'ncurses':
# Building with the system-suppied combined libncurses/libpanel
curses_defines.append(('HAVE_NCURSESW', '1'))
curses_defines.append(('_XOPEN_SOURCE_EXTENDED', '1'))

In fact, wide char support is always available when using Apple-provided ncurses, and it used to work correctly in the 3.11 builds that I tested.

@tiran can you confirm that this was unintended?

cc @sobolevn who interpreted this as an intended change in python/typeshed#10808.

CPython versions tested on:

3.12, 3.13

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    OS-macbuildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions