Skip to content

gh-102572: Fix KeyboardInterrupt/SystemExit in TaskGroup child task crashing the event loop - #154761

Draft
kumaraditya303 wants to merge 1 commit into
python:mainfrom
kumaraditya303:gh-102572-taskgroup-base-exc
Draft

gh-102572: Fix KeyboardInterrupt/SystemExit in TaskGroup child task crashing the event loop#154761
kumaraditya303 wants to merge 1 commit into
python:mainfrom
kumaraditya303:gh-102572-taskgroup-base-exc

Conversation

@kumaraditya303

@kumaraditya303 kumaraditya303 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

A KeyboardInterrupt or SystemExit raised by a task in a TaskGroup was both set as the task's exception and re-raised into the event loop, stopping it before the group could re-raise the exception in the parent task as documented.

Task now only re-raises KeyboardInterrupt/SystemExit into the event loop when the private flag Task._reraise_base_exceptions is true (the default); TaskGroup disables it for its child tasks since it delivers the exception to the parent task itself.

…ng the event loop

A KeyboardInterrupt or SystemExit raised by a task in a TaskGroup was
both set as the task's exception and re-raised into the event loop,
stopping it before the group could re-raise the exception in the parent
task as documented.

Task now only re-raises KeyboardInterrupt/SystemExit into the event loop
when the private flag Task._reraise_base_exceptions is true (the
default); TaskGroup disables it for its child tasks since it delivers
the exception to the parent task itself.
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.

1 participant