Skip to content

gh-152789: Skip curses tests needing newterm() on ncurses before 6.5#152880

Merged
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:gh-152789-skip-screentests-old-ncurses
Jul 2, 2026
Merged

gh-152789: Skip curses tests needing newterm() on ncurses before 6.5#152880
serhiy-storchaka merged 1 commit into
python:mainfrom
serhiy-storchaka:gh-152789-skip-screentests-old-ncurses

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 2, 2026

Copy link
Copy Markdown
Member

ncurses before 6.5 mishandles repeated newterm(): a later call per process can corrupt screen state and crash (SIGSEGV in wnoutrefresh()), as seen on the ARM64 Raspbian buildbot. It was fixed in ncurses 6.5.

On such a build, TestCurses now falls back to initscr() instead of newterm(), and ScreenTests and SLKTests (which need several newterm() screens and have no initscr() fallback) are skipped. Since the fallback makes every test share one initscr() screen instead of getting a fresh one from newterm(), setUp() also resets the current rendition and the background, which a previous test would otherwise leave to bleed into this one.

Verified against locally built ncurses 6.4, 6.5 and 6.6 (widec + sp-funcs): 6.4 crashes without the change and passes with it (headless and on a real pty); 6.5 and 6.6 run the full suite unchanged, with nothing over-skipped.

…e 6.5

ncurses before 6.5 can crash on repeated newterm().  Fall back to initscr()
in TestCurses and skip ScreenTests and SLKTests, which need several screens.
The shared initscr() screen also needs its rendition and background reset
between tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bedevere-app bedevere-app Bot added tests Tests in the Lib/test dir awaiting core review labels Jul 2, 2026
@serhiy-storchaka serhiy-storchaka merged commit 3428959 into python:main Jul 2, 2026
54 checks passed
@serhiy-storchaka serhiy-storchaka deleted the gh-152789-skip-screentests-old-ncurses branch July 2, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant