Skip to content

gh-159323: PyREPL on Windows should exit when STDIN is NUL - #159368

Open
edvilme wants to merge 3 commits into
python:mainfrom
edvilme:pyrepl-windows-null
Open

edvilme wants to merge 3 commits into
python:mainfrom
edvilme:pyrepl-windows-null

Conversation

@edvilme

@edvilme edvilme commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

On Windows, when stdin is NUL, starting the REPL results on an exception loop because it is not caught by os.isatty

On Windows, when stdin is `NUL`, starting the REPL results on an
exception loop because it is not caught by `os.isatty`
Comment thread Lib/_pyrepl/readline.py Resolved
)

self.assertEqual(proc.returncode, 0, proc.stderr)
self.assertIn("tty required", proc.stderr)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current Windows console setup already rejects NUL before the prompt loop. Can we check whether the hang still occurs on a current build? This assertion only checks the warning text.

@bedevere-app

bedevere-app Bot commented Nov 26, 2026

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants