Skip to content

gh-90092: Fix test_curses when stdin is write-only (e.g. under nohup)#153420

Open
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:curses-test-newterm-stdin
Open

gh-90092: Fix test_curses when stdin is write-only (e.g. under nohup)#153420
serhiy-storchaka wants to merge 1 commit into
python:mainfrom
serhiy-storchaka:curses-test-newterm-stdin

Conversation

@serhiy-storchaka

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

Copy link
Copy Markdown
Member

test_curses fails in setUp() when the suite is run backgrounded under nohup:

OSError: [Errno 22] Invalid argument

setUp() derives the newterm() input fd from stdin, but nohup leaves stdin write-only when it backgrounds a run started from a terminal, and newterm() rejects a write-only input fd. Fall back to the output fd in that case, as is already done when stdin has no fileno().

This only affects builds using the newterm() path (ncurses 6.5+); the previous initscr() path tolerated a write-only stdin.

Reported by @weixlu.

…nohup)

newterm() needs a readable input fd, but nohup can leave stdin write-only.
Fall back to the output fd, as already done when stdin has no fileno.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant