GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Restore ncurses widechar support on macOS · Issue #111460 · python/cpython

Restore ncurses widechar support on macOS #111460

New issue
Copy link
New issue
Copy link
Closed
Closed
Restore ncurses widechar support on macOS#111460
Copy link
Labels
OS-macbuildThe build process and cross-buildThe build process and cross-buildtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@sorcio
sorcio
opened on Oct 29, 2023
Issue body actions

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

  • gh-111460: restore ncurses widechar support on macOS #111878
  • [3.12] gh-111460: Restore ncurses widechar support on macOS (GH-111878) #112034

Activity

  1. sorcio
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Oct 29, 2023
  2. ned-deily
    added
    OS-mac
    buildThe build process and cross-buildThe build process and cross-build
    on Oct 29, 2023
  3. ned-deily commented on Oct 29, 2023

    @ned-deily
    ned-deily
    on Oct 29, 2023
    Member
    More actions

    @erlend-aasland

    Reacted by Erlend E. Aasland
  4. serhiy-storchaka
    added this to Curses issueson Oct 29, 2023
  5. erlend-aasland commented on Oct 29, 2023

    @erlend-aasland
    erlend-aasland
    on Oct 29, 2023
    Contributor
    More actions

    Yes, this is probably an unintended side effect. I can look into it tomorrow.

    (cc. @corona10, if you are interested)

    Reacted by Donghee Na
  6. corona10 commented on Oct 29, 2023

    @corona10
    corona10
    on Oct 29, 2023
    Member
    More actions

    Yeah I will take a look too

    Reacted by Erlend E. Aasland
  7. sorcio commented on Oct 30, 2023

    @sorcio
    sorcio
    on Oct 30, 2023
    ContributorAuthor
    More actions

    Would it be interesting to encode some platform expectations in tests?

    This regression went under the radar because test_unget_wch is skipped with @requires_curses_func('unget_wch'), among other reasons. Skipping makes sense in general. But in some build configurations (including macOS CI, macOS buildbots, and the official macOS installer) we know that we are building with ncurses, and unget_wch should exist.

    Since this functionality is documented to be generally available, should a test assert that it actually is?

  8. sorcio
    added a commit that references this issue on Nov 9, 2023

    pythongh-111460: restore ncurses widechar support on macOS

    e1a1e32
  9. sorcio commented on Nov 9, 2023

    @sorcio
    sorcio
    on Nov 9, 2023
    ContributorAuthor
    More actions

    Maybe it was a one-character fix after all: #111878

    (Note: if you are testing curses on macOS <14, you might need #111258 or a similar fix)

    Should some test be added?

  10. corona10
    added a commit that references this issue on Nov 13, 2023

    gh-111460: Restore ncurses widechar support on macOS (#111878)

    d2f305d
  11. miss-islington
    added a commit that references this issue on Nov 13, 2023

    pythongh-111460: Restore ncurses widechar support on macOS (pythonGH-…

    7f106a6
  12. corona10
    added a commit that references this issue on Nov 14, 2023

    [3.12] gh-111460: Restore ncurses widechar support on macOS (GH-111878)…

    d34650e
  13. erlend-aasland commented on Nov 14, 2023

    @erlend-aasland
    erlend-aasland
    on Nov 14, 2023
    Contributor
    More actions

    Can this be closed?

  14. sorcio commented on Nov 14, 2023

    @sorcio
    sorcio
    on Nov 14, 2023
    ContributorAuthor
    More actions

    @erlend-aasland if there is no need to test this, we're done here.

  15. erlend-aasland commented on Nov 14, 2023

    @erlend-aasland
    erlend-aasland
    on Nov 14, 2023
    Contributor
    More actions

    @erlend-aasland if there is no need to test this, we're done here.

    There's always a need for accompanying tests.

  16. sorcio commented on Nov 19, 2023

    @sorcio
    sorcio
    on Nov 19, 2023
    ContributorAuthor
    More actions

    I need help with this then. What is a test supposed to test? We could say that wide char support should always be there on Darwin, but it could fail on builds that bring their own curses (or not).

  17. ronaldoussoren commented on Dec 5, 2023

    @ronaldoussoren
    ronaldoussoren
    on Dec 5, 2023
    Contributor
    More actions

    @erlend-aasland : What kind of tests do you want to see here? AFAIK we generally don't test if expected platform features are present, other than some tests I've added when working on the Universal 2 port to ensure that weak linking works as expected.

  18. erlend-aasland commented on Dec 5, 2023

    @erlend-aasland
    erlend-aasland
    on Dec 5, 2023
    Contributor
    More actions

    I did not have anything in particular in mind. If there is no particular need, let's just close this.

    Reacted by Ronald Oussoren
  19. erlend-aasland
    added
    pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
    on Dec 5, 2023
  20. ronaldoussoren
    removed
    pendingThe issue will be closed if no feedback is providedThe issue will be closed if no feedback is provided
    on Dec 5, 2023
  21. ronaldoussoren
    closed this as completedon Dec 5, 2023
  22. github-project-automation
    moved this to Done in Curses issueson Dec 5, 2023
  23. aisk
    added a commit that references this issue on Feb 11, 2024

    pythongh-111460: Restore ncurses widechar support on macOS (python#11…

    1a9c29e
  24. Glyphack
    added a commit that references this issue on Sep 2, 2024

    pythongh-111460: Restore ncurses widechar support on macOS (python#11…

    63654b4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Projects

    • Curses issues
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.