Title: gh-152502: Detect optional curses functions with configure probes by serhiy-storchaka · Pull Request #152504 · python/cpython · GitHub
Open Graph Title: gh-152502: Detect optional curses functions with configure probes by serhiy-storchaka · Pull Request #152504 · python/cpython
X Title: gh-152502: Detect optional curses functions with configure probes by serhiy-storchaka · Pull Request #152504 · python/cpython
Description: Issue: gh-152502 Some functions in Modules/_cursesmodule.c were called unconditionally or gated only by the ncurses-specific NCURSES_EXT_FUNCS macro, which broke building the module against curses implementations other than ncursesw (narrow ncurses, NetBSD curses) even when the library provided the function. Detect each with a configure capability probe and gate on HAVE_CURSES_*: new PY_CHECK_CURSES_FUNC probes for scr_dump (one probe gates the inseparable scr_dump/scr_restore/scr_init/scr_set family), key_defined, term_attrs, define_key, keyok, set_escdelay, set_tabsize; a new PY_CHECK_CURSES_VAR macro for get_escdelay/get_tabsize, which read the ESCDELAY/TABSIZE variables rather than functions; test_env_queries now guards term_attrs() with hasattr(). None of these are in X/Open Curses; they are ncurses extensions (NetBSD provides compatible ones), so a capability probe is more portable than conditioning on NCURSES_VERSION. No behaviour change on standard ncursesw. test_curses passes and is refleak-clean on wide ncursesw, narrow ncurses, and NetBSD curses, under UTF-8 and 8-bit locales. Note: configure was edited by hand; please run make regen-configure to confirm it matches the pinned autoconf toolchain. 🤖 Generated with Claude Code
Open Graph Description: Issue: gh-152502 Some functions in Modules/_cursesmodule.c were called unconditionally or gated only by the ncurses-specific NCURSES_EXT_FUNCS macro, which broke building the module against curse...
X Description: Issue: gh-152502 Some functions in Modules/_cursesmodule.c were called unconditionally or gated only by the ncurses-specific NCURSES_EXT_FUNCS macro, which broke building the module against curse...
Opengraph URL: https://github.com/python/cpython/pull/152504
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:1b54895b-a8c0-8537-77dc-4ac4fc3919e8 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | ADB0:141904:19A60E3:21AC180:6A51D020 |
| html-safe-nonce | b23ad252cb8a070e17b7f27a6c07f90d634429d071b62d152496954d6cd6e42d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBREIwOjE0MTkwNDoxOUE2MEUzOjIxQUMxODA6NkE1MUQwMjAiLCJ2aXNpdG9yX2lkIjoiODgxMDk2OTkxODgyNjcyOTUwNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5dc3b57ea3a4e483bfa3559513437b6c87c8a4253af77401e8ca7c577460b4e3 |
| hovercard-subject-tag | pull_request:3951262562 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/152504/files |
| twitter:image | https://avatars.githubusercontent.com/u/3659035?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/3659035?s=400&v=4 |
| og:image:alt | Issue: gh-152502 Some functions in Modules/_cursesmodule.c were called unconditionally or gated only by the ncurses-specific NCURSES_EXT_FUNCS macro, which broke building the module against curse... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width