Replace bare except with except Exception in task-sdk supervisor - #69544
Open
bramhanandlingala wants to merge 1 commit into
Open
bramhanandlingala wants to merge 1 commit into
bramhanandlingala wants to merge 1 commit into
Conversation
bramhanandlingala
requested review from
amoghrajesh,
ashb and
kaxil
as code owners
July 7, 2026 12:48
This comment was marked as spam.
This comment was marked as spam.
Contributor
Author
|
Hi @Vamsi-klu Could you please review the code and approve the PR |
1 task done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Issue #69441 flags exception handlers that catch overly broad types,
which can hide real errors or interfere with signal handling. I looked
for bare
except:clauses specifically, since those catch everythingincluding
KeyboardInterrupt/SystemExit. There were two left in therepo outside of tests/docs.
1. Task-SDK supervisor — the bare except around coordinator init
always re-raised afterward, so signals weren't actually swallowed, just
logged with a misleading traceback before exiting. Narrowed to
except Exception:so real errors are still logged the same way, butCtrl+C/shutdown no longer produce that spurious log line.
2. Pytest plugin — a bare
except: raisethat did nothing (purere-raise, no logging). Removed it; the
finallybelow already handlescleanup.
Didn't touch the other
except Exception:blocks in core — those don'thave this bare-except issue, and a full rewrite is a separate effort.
related: #69441
Gen-AI disclosure: I used a generative AI tool to help identify the root
cause, write tests, and draft the PR description. I reviewed, tested, and
verified all changes locally before submitting.
Was generative AI tooling used to co-author this PR?
Generated-by: Claude following the guidelines