Skip to content

gh-152325: Gate curses.has_mouse() on the ncurses patch level#152652

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:gh-152325-has-mouse-probe
Jun 30, 2026
Merged

gh-152325: Gate curses.has_mouse() on the ncurses patch level#152652
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:gh-152325-has-mouse-probe

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jun 30, 2026

Copy link
Copy Markdown
Member

Buildbot fix for gh-152325.

has_mouse() was added to ncurses after the 5.7 release (2008-11-22), but the binding guarded it only with NCURSES_MOUSE_VERSION, which 5.7 already defines. On ncurses 5.7 — such as the system curses on macOS — has_mouse() is undeclared, and with clang treating implicit declarations as errors _cursesmodule.c failed to compile, breaking a number of buildbots.

Gate has_mouse() additionally on NCURSES_EXT_FUNCS, which holds the library's patch date when extended functions are enabled (the default), matching the existing is_cleared/is_cbreak guards.

wmouse_trafo()/mouse_trafo() need no guard — they are the same vintage as wenclose()/enclose(), which already compile on those buildbots.

has_mouse() was added to ncurses after the 5.7 release, but the binding
guarded it only with NCURSES_MOUSE_VERSION, which 5.7 already defines, so
the module failed to compile against ncurses 5.7 (such as the system
curses on macOS).  Gate it additionally on NCURSES_EXT_FUNCS, which holds
the library's patch date.

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

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33370155 | 📁 Comparing 46863ea against main (449122e)

  🔍 Preview build  

1 file changed
± library/curses.html

@serhiy-storchaka serhiy-storchaka enabled auto-merge (squash) June 30, 2026 08:45
@serhiy-storchaka serhiy-storchaka merged commit 11d42bd into python:main Jun 30, 2026
58 checks passed
@serhiy-storchaka serhiy-storchaka deleted the gh-152325-has-mouse-probe branch July 1, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant