René's URL Explorer Experiment


Title: test_curses fails in every Ubuntu CI run's parallel phase: test_use_prescr_screen leaves use_env(False) set, so newterm() fails with TERM=linux · Issue #157170 · python/cpython · GitHub

Open Graph Title: test_curses fails in every Ubuntu CI run's parallel phase: test_use_prescr_screen leaves use_env(False) set, so newterm() fails with TERM=linux · Issue #157170 · python/cpython

X Title: test_curses fails in every Ubuntu CI run's parallel phase: test_use_prescr_screen leaves use_env(False) set, so newterm() fails with TERM=linux · Issue #157170 · python/cpython

Description: Bug report Bug description: On every recent Ubuntu CI job on main, test_curses fails in the parallel phase with 138 errors and only passes on the automatic sequential rerun, so the failure never shows up as a red check. I sampled the las...

Open Graph Description: Bug report Bug description: On every recent Ubuntu CI job on main, test_curses fails in the parallel phase with 138 errors and only passes on the automatic sequential rerun, so the failure never sh...

X Description: Bug report Bug description: On every recent Ubuntu CI job on main, test_curses fails in the parallel phase with 138 errors and only passes on the automatic sequential rerun, so the failure never sh...

Opengraph URL: https://github.com/python/cpython/issues/157170

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"test_curses fails in every Ubuntu CI run's parallel phase: test_use_prescr_screen leaves use_env(False) set, so newterm() fails with TERM=linux","articleBody":"# Bug report\n\n### Bug description:\n\nOn every recent Ubuntu CI job on main, `test_curses` fails in the parallel phase with 138 errors and only passes on the automatic sequential rerun, so the failure never shows up as a red check. I sampled the last 8 successful Tests runs: all 31 Ubuntu job runs (x86-64 and arm64, default and free-threading builds) show `test_curses failed (138 errors)` followed by `test_curses passed` on the rerun. Example, the free-threading job of https://github.com/python/cpython/actions/runs/34185684639: `test_curses failed (138 errors)` at 0:11:27 and `[1/1] test_curses passed` at 0:13:58. Every error is the same:\n\n```\nERROR: test_add_string_behavior (test.test_curses.TestCurses.test_add_string_behavior)\n  File \".../Lib/test/test_curses.py\", line 183, in setUp\n    self.screen = curses.newterm(term, stdout_fd, infd)\ncurses.error: newterm() returned NULL\n```\n\nThe 138 errors are every test of `TestCurses` (and the textbox/panel tests that share its `setUp()`), so in effect those tests only run in the rerun, and only there because the rerun re-runs the failed tests by name and therefore skips `ScreenTests`.\n\n### Cause\n\n`ScreenTests.test_use_prescr_screen` ends with\n\n```python\n        # Affecting the state before initscr() is what such a screen is for.\n        prescr.use(lambda scr: curses.use_env(False))\n```\n\nand never turns `use_env` back on. `curses.use_env()` calls ncurses' `use_env()`, which sets the process-wide default `_nc_prescreen.use_env`, not a property of the screen that is current when it is called, and every screen created afterwards copies that default. With `use_env(False)`, ncurses takes the screen size from the terminfo `lines` and `cols` capabilities alone, without the `LINES`/`COLUMNS` environment or the 24x80 fallback. The CI runners have `TERM=linux`, and the `linux` terminfo entry has no `lines` or `cols`:\n\n```\n$ infocmp -1 linux | grep -E 'lines#|cols#'      # nothing\n$ infocmp -1 xterm | grep -E 'lines#|cols#'      # cols#80 lines#24\n```\n\nso every `newterm()` after that test computes a -1x-1 screen and returns NULL. With `TERM=xterm` or `vt100` the size comes from terminfo and the module passes, which is why this does not show up on developer machines.\n\nI confirmed this with an ncurses 6.5 built with `--with-trace`. For a `newterm(\"linux\", ...)` after `test_use_prescr_screen`:\n\n```\ncalled {newterm(0xba7a54022bc0, \"linux\", 0xba7a53dd7120,0xba7a53d4a6c0)\nscreen size: terminfo lines = -1 columns = -1\nuseEnv:0 useTioctl:0\nscreen size is -1x-1\n```\n\nwhereas before that test, or after restoring `use_env(True)`, it reads `useEnv:1` and `screen size is 24x80`.\n\n### Reproducer\n\nOn Ubuntu 25.10 (ncurses 6.5, so the `newterm()`-based `setUp()` is used) with a debug build of main:\n\n```\n$ TERM=linux ./python -m test test_curses -u curses      # test_curses failed (138 errors)\n$ TERM=xterm ./python -m test test_curses -u curses      # test_curses passed\n```\n\nRestoring the setting in the test (`self.addCleanup(curses.use_env, True)` before the `prescr.use(...)` line) makes the module pass with `TERM=linux`, and a `--fast-ci` run then needs no rerun. I will open a PR.\n\nThe docs for `curses.use_env()` could also say that the setting is process-wide and not tied to a screen, since the comment in the test shows the opposite was assumed.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-157171\n* gh-157207\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/iamsharduld","@type":"Person","name":"iamsharduld"},"datePublished":"2026-09-08T06:21:36Z","url":"https://github.com/python/cpython/issues/157170"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:93415f82-f2b4-c683-2cef-839c823c30b4
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDDD0:2454CC:37DD7B6:46E37A8:6B01F24A
html-safe-nonce99b6930ab8250d534d09f748ed7716188db63bac5fd10c6526c3205dd01a2841
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEREQwOjI0NTRDQzozN0REN0I2OjQ2RTM3QTg6NkIwMUYyNEEiLCJ2aXNpdG9yX2lkIjoiNTMxOTAyMDQ1MTg3NDMzNzM1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac665d4f63bb54bccadd8f458ca6cdc52a5dd2bc7b01d168c75838b5f0fe051b12
hovercard-subject-tagissue:5382974104
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/157170/issue_layout
twitter:imagehttps://opengraph.githubassets.com/cc64d9768ec628467e616b8c67ce29cde629c55ffbb1ab450ca37d6c8f99a2c3/python/cpython/issues/157170
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/cc64d9768ec628467e616b8c67ce29cde629c55ffbb1ab450ca37d6c8f99a2c3/python/cpython/issues/157170
og:image:altBug report Bug description: On every recent Ubuntu CI job on main, test_curses fails in the parallel phase with 138 errors and only passes on the automatic sequential rerun, so the failure never sh...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameiamsharduld
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/157170#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F157170
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F157170
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/157170
Reloadhttps://github.com/python/cpython/issues/157170
Reloadhttps://github.com/python/cpython/issues/157170
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/157170
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/157170
test_curses fails in every Ubuntu CI run's parallel phase: test_use_prescr_screen leaves use_env(False) set, so newterm() fails with TERM=linuxhttps://github.com/python/cpython/issues/157170#top
testsTests in the Lib/test dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22tests%22
topic-curseshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-curses%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/iamsharduld
iamsharduldhttps://github.com/iamsharduld
on Sep 8, 2026https://github.com/python/cpython/issues/157170#issue-5382974104
https://github.com/python/cpython/actions/runs/34185684639https://github.com/python/cpython/actions/runs/34185684639
gh-157170: Restore use_env() after test_use_prescr_screen in test_curses #157171https://github.com/python/cpython/pull/157171
gh-157170: Document the scope of global curses settings #157207https://github.com/python/cpython/pull/157207
aiskhttps://github.com/aisk
testsTests in the Lib/test dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22tests%22
on Sep 8, 2026https://github.com/python/cpython/issues/157170#event-30733423509
https://github.com/iamsharduld
iamsharduldhttps://github.com/iamsharduld
on Sep 8, 2026https://github.com/python/cpython/issues/157170#issuecomment-5580705871
#157171https://github.com/python/cpython/pull/157171
https://github.com/python/cpython/actions/runs/34194369258https://github.com/python/cpython/actions/runs/34194369258
StanFromIrelandhttps://github.com/StanFromIreland
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
topic-curseshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-curses%22
on Sep 8, 2026https://github.com/python/cpython/issues/157170#event-30763196721
serhiy-storchakahttps://github.com/serhiy-storchaka
on Sep 9, 2026https://github.com/python/cpython/issues/157170#event-30817034936
gh-157170: Restore use_env() after test_use_prescr_screen in test_cur…https://github.com/python/cpython/commit/5f14441114af4b8aadf45aa0dd764e43f5eedd5d
gh-157170https://github.com/python/cpython/issues/157170
5f14441https://github.com/python/cpython/commit/5f14441114af4b8aadf45aa0dd764e43f5eedd5d
gh-157170: Document the scope of global curses settings (GH-157207)https://github.com/python/cpython/commit/4de00a42661a1c280e06d2d5d71c4f69eda41562
gh-157170https://github.com/python/cpython/issues/157170
GH-157207https://github.com/python/cpython/pull/157207
4de00a4https://github.com/python/cpython/commit/4de00a42661a1c280e06d2d5d71c4f69eda41562
serhiy-storchakahttps://github.com/serhiy-storchaka
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Sep 9, 2026https://github.com/python/cpython/issues/157170#event-30831348190
maurycyhttps://github.com/maurycy
on Sep 10, 2026https://github.com/python/cpython/issues/157170#event-30913518845
Merge branch 'main' into tachyon-native-callablehttps://github.com/maurycy/cpython/commit/e028ff54dbf50b4ed3a72a6ec9d41eb721eb66b2
e028ff5https://github.com/maurycy/cpython/commit/e028ff54dbf50b4ed3a72a6ec9d41eb721eb66b2
clin1234https://github.com/clin1234
on Sep 12, 2026https://github.com/python/cpython/issues/157170#event-31023920248
pythongh-157170: Restore use_env() after test_use_prescr_screen in te…https://github.com/clin1234/cpython/commit/df09d291273445d908841fed12059b5f22f7598a
pythongh-157170https://github.com/python/cpython/issues/157170
df09d29https://github.com/clin1234/cpython/commit/df09d291273445d908841fed12059b5f22f7598a
pythongh-157170: Document the scope of global curses settings (python…https://github.com/clin1234/cpython/commit/2ed3076f03fab3ac7eddae6f354066dcb6a42fe9
pythongh-157170https://github.com/python/cpython/issues/157170
python…https://github.com/python/cpython/pull/157207
2ed3076https://github.com/clin1234/cpython/commit/2ed3076f03fab3ac7eddae6f354066dcb6a42fe9
johnslavikhttps://github.com/johnslavik
on Sep 14, 2026https://github.com/python/cpython/issues/157170#event-31099053304
pythongh-157170: Restore use_env() after test_use_prescr_screen in te…https://github.com/johnslavik/cpython/commit/c0b724849f132771cfd51a46720473d1ecef5ec5
pythongh-157170https://github.com/python/cpython/issues/157170
c0b7248https://github.com/johnslavik/cpython/commit/c0b724849f132771cfd51a46720473d1ecef5ec5
pythongh-157170: Document the scope of global curses settings (python…https://github.com/johnslavik/cpython/commit/8b3efb00384589563f8f89124683e7cc03c90f0f
pythongh-157170https://github.com/python/cpython/issues/157170
python…https://github.com/python/cpython/pull/157207
8b3efb0https://github.com/johnslavik/cpython/commit/8b3efb00384589563f8f89124683e7cc03c90f0f
serhiy-storchakahttps://github.com/serhiy-storchaka
Curses issueshttps://github.com/orgs/python/projects/18
on Oct 18, 2026https://github.com/python/cpython/issues/157170#event-33561859067
github-project-automationhttps://github.com/apps/github-project-automation
Curses issueshttps://github.com/orgs/python/projects/18
on Oct 18, 2026https://github.com/python/cpython/issues/157170
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/157170
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/157170
testsTests in the Lib/test dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22tests%22
topic-curseshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-curses%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
Curses issueshttps://github.com/orgs/python/projects/18
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.