Skip to content

gh-132308: TracebackException swallows attributes of falsey Exception and falsey ExceptionGroup#132363

Merged
picnixz merged 16 commits intopython:mainfrom
YvesDup:TracebackException-swallows-cause-context-flasey-exception
Apr 19, 2025
Merged

gh-132308: TracebackException swallows attributes of falsey Exception and falsey ExceptionGroup#132363
picnixz merged 16 commits intopython:mainfrom
YvesDup:TracebackException-swallows-cause-context-flasey-exception

Conversation

@YvesDup
Copy link
Contributor

@YvesDup YvesDup commented Apr 10, 2025

Summary

An x is falsey if len(x) returns 0 or bool(x) returns False

TracebackException class swallows the following attributes of falsey Exception:

  • __cause__
  • __context__

TracebackException swallows all sub-exceptions of falsey ExceptionGroup

The fix is located in the __init__ method of the TracebackException class.

Loading
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.

3 participants