Stop swallowing handler errors when errors='raise' - #629
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #629 +/- ##
==========================================
+ Coverage 85.04% 85.18% +0.13%
==========================================
Files 45 45
Lines 5691 5743 +52
Branches 459 460 +1
==========================================
+ Hits 4840 4892 +52
Misses 721 721
Partials 130 130 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
RazerM
force-pushed
the
fix/handler-raise-policy
branch
4 times, most recently
from
September 6, 2026 18:27
1e56f0e to
cd74e51
Compare
handle_error kept the flag check and the stacktrace print in one try/except OSError. That except is there for the print, but it also caught the exception handle_error re-raises for 'raise'. Most handler failures are OSError, so most of them raised nothing. The except predates the flag. In 2010 it wrapped the print alone, and the raise landed inside it when the flag stack arrived two months later. CPython scopes the same suppression to the print, see python/cpython#50221.
RazerM
force-pushed
the
fix/handler-raise-policy
branch
from
September 6, 2026 19:48
cd74e51 to
bc2c064
Compare
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.
handle_error kept the flag check and the stacktrace print in one
try/except OSError. That except is there for the print, but it also
caught the exception handle_error re-raises for 'raise'. Most handler
failures are OSError, so most of them raised nothing.
The except predates the flag. In 2010 it wrapped the print alone, and
the raise landed inside it when the flag stack arrived two months
later. CPython scopes the same suppression to the print, see
python/cpython#50221.