Title: gh-157170: Restore use_env() after test_use_prescr_screen in test_curses by iamsharduld · Pull Request #157171 · python/cpython · GitHub
Open Graph Title: gh-157170: Restore use_env() after test_use_prescr_screen in test_curses by iamsharduld · Pull Request #157171 · python/cpython
X Title: gh-157170: Restore use_env() after test_use_prescr_screen in test_curses by iamsharduld · Pull Request #157171 · python/cpython
Description: test_use_prescr_screen turns use_env off to show that a new_prescr() screen can be used to affect state before initscr(), and never turns it back on. curses.use_env() calls ncurses' use_env(), which sets the process-wide default (_nc_prescreen.use_env) that every later screen copies, not a property of the screen that is current at the time. With it off, ncurses sizes a screen from the terminfo lines/cols capabilities alone, and the linux entry used by the CI runners has none, so every newterm() for the rest of the process returns NULL. That is the 138 errors test_curses reports in the parallel phase of every Ubuntu CI run (all 31 Ubuntu job runs in the last 8 successful runs on main); the sequential rerun passes only because it re-runs the failed tests by name and so never runs ScreenTests first. Details, including an ncurses trace of the failing newterm(), are in the issue. This restores the setting with addCleanup(). Verified on Ubuntu 25.10 with ncurses 6.5 (the newterm-based setUp() needs ncurses 6.5 or newer): TERM=linux ./python -m test test_curses -u curses: 138 errors before, passes after (three consecutive runs). TERM=linux ./python -m test --fast-ci test_curses: no rerun needed after. TERM=xterm still passes. On macOS the ScreenTests are skipped (ncurses 6.0), which is why this was invisible on developer machines. Issue: gh-157170
Open Graph Description: test_use_prescr_screen turns use_env off to show that a new_prescr() screen can be used to affect state before initscr(), and never turns it back on. curses.use_env() calls ncurses' use_env(), ...
X Description: test_use_prescr_screen turns use_env off to show that a new_prescr() screen can be used to affect state before initscr(), and never turns it back on. curses.use_env() calls ncurses' use_env...
Opengraph URL: https://github.com/python/cpython/pull/157171
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:5656cda0-c674-65b8-46cd-70321598541f |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C8D2:1050BD:146F6A1:1B0B385:6B01F88B |
| html-safe-nonce | fda2bb09d78a031e5a72fb008d0be8ac24e69958d3e99969a35d334e6110b266 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOEQyOjEwNTBCRDoxNDZGNkExOjFCMEIzODU6NkIwMUY4OEIiLCJ2aXNpdG9yX2lkIjoiODcxNDQ0NzAwMTM3NjM4OTI1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3b33c9354299a265c47e850804a33f53336824edf2f8364895cc53e3e9a0b9ff |
| hovercard-subject-tag | pull_request:4471051460 |
| 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/157171/files |
| twitter:image | https://avatars.githubusercontent.com/u/8417988?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/8417988?s=400&v=4 |
| og:image:alt | test_use_prescr_screen turns use_env off to show that a new_prescr() screen can be used to affect state before initscr(), and never turns it back on. curses.use_env() calls ncurses' use_env(), ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width