Skip to content

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

Merged
terryjreedy merged 3 commits into
python:3.15from
miss-islington:backport-9232c21-3.15
Oct 9, 2026
Merged

terryjreedy merged 3 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)
@terryjreedy
terryjreedy merged commit 0ae3ed5 into python:3.15 Oct 9, 2026
53 checks passed
@miss-islington
miss-islington deleted the backport-9232c21-3.15 branch October 9, 2026 21:11
@terryjreedy terryjreedy removed this from IDLE Issues Oct 9, 2026
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.

4 participants