Skip to content

gh-161254: Defer registering SIGCONT handler until UnixConsole is actually used - #161255

Open
meshulam wants to merge 3 commits into
python:mainfrom
meshulam:pyrepl-console-crash
Open

meshulam wants to merge 3 commits into
python:mainfrom
meshulam:pyrepl-console-crash

Conversation

@meshulam

@meshulam meshulam commented Nov 3, 2026

Copy link
Copy Markdown

Fixes an issue where the default sys.__interactivehook__() registers a signal handler for a pyrepl UnixConsole that may never actually be used, causing a crash when the SIGCONT signal is received.

This is the most visible part of gh-161254 but does not resolve the underlying issue of pyrepl and code.interact() not playing well together.

@python-cla-bot

python-cla-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app

bedevere-app Bot commented Nov 3, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

del self.old_sigwinch

try:
signal.signal(signal.SIGCONT, signal.SIG_DFL)

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.

This replaces the caller's SIGCONT handler with SIG_DFL. Can we save the previous handler in prepare() and restore it here?

@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