Skip to content

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

Merged
serhiy-storchaka merged 1 commit into
python:3.14from
miss-islington:backport-9232c21-3.14
Sep 23, 2026
Merged

serhiy-storchaka merged 1 commit into
python:3.14from
miss-islington:backport-9232c21-3.14

Conversation

@miss-islington

@miss-islington miss-islington commented Sep 23, 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>
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) September 23, 2026 18:34
@serhiy-storchaka
serhiy-storchaka merged commit 824b67e into python:3.14 Sep 23, 2026
51 checks passed
@miss-islington
miss-islington deleted the backport-9232c21-3.14 branch September 23, 2026 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants