Skip to content

[3.15] gh-74112: Make Ctrl-C in the IDLE Shell interrupt blocking calls (GH-157662) - #158917

Open
miss-islington wants to merge 2 commits into
python:3.15from
miss-islington:backport-9232c21-3.15
Open

miss-islington wants to merge 2 commits into
python:3.15from
miss-islington:backport-9232c21-3.15

Conversation

@miss-islington

@miss-islington miss-islington commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Send a real SIGINT to the main thread of the user process instead of
calling _thread.interrupt_main(), which only sets a flag checked
between bytecodes. The signal is sent while holding a new lock which
protects sending a message, so that the main thread is not interrupted
in the middle of a message. An interrupted wait for a response now
releases its lock, so that the socket thread does not deadlock.
(cherry picked from commit 9232c21)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com

pythonGH-157662)

Send a real SIGINT to the main thread of the user process instead of
calling _thread.interrupt_main(), which only sets a flag checked
between bytecodes.  The signal is sent while holding a new lock which
protects sending a message, so that the main thread is not interrupted
in the middle of a message.  An interrupted wait for a response now
releases its lock, so that the socket thread does not deadlock.
(cherry picked from commit 9232c21)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…8914)

On a loaded machine the KeyboardInterrupt could be raised before the main
thread reached time.sleep(), escape the test and stop the whole regrtest run.

(cherry picked from commit ea0ee92)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants