-
-
Notifications
You must be signed in to change notification settings - Fork 264
fix RecursionError when logging re-raised Exception from an ExceptionGroup #727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
lgtm :) |
|
Maybe we could create a |
I've reviewed the implementation in _compat module , but checking Python version ranges (e.g., ensuring the version is between 3.9 and 3.11) becomes quite cumbersome with this approach. |
|
Perhaps all we need is just a constant to indicate whether the current Python version supports ExceptionGroup. |
|
The problem with all these constants instead of straight version checks is – last time I checked – that they're not supported by Mypy and you'll get weird errors about undefined symbols etc. Not sure if that changed? |
|
Then let's keep the PR as it is. The "python version checking" issue is unrelated to the issue that this PR addresses. |
|
hopefully fixed by #739 with credit to you – sorry for the delays |
Summary
Fixed a RecursionError when logging re-raised exceptions from an ExceptionGroup in Python 3.11 and above (#726). The fix adds a version check and detects when the exception cause is an ExceptionGroup, preventing further recursive traversal of the exception chain, which previously led to infinite recursion.
Pull Request Check List
mainbranch – use a separate branch!api.py.docs/api.rstby hand.versionadded,versionchanged, ordeprecateddirectives..rstand.mdfiles is written using semantic newlines.