-
Notifications
You must be signed in to change notification settings - Fork 20
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
Traceback broken for AttributeError with name only #43
Comments
@cfbolz comments? |
right, I see. yes, it should definitely not crash, sorry for not thinking about this case. I'm fixing it. |
cfbolz
added a commit
to cfbolz/exceptiongroup
that referenced
this issue
Nov 15, 2022
deal with this situation without crashing, AttributeError.obj is only always there after 3.10
No problem, thanks for the quick resolution! |
@sanderr are you able to test against |
It works as expected:
|
Released v1.0.4. |
Thanks a lot! I really hadn't expected this to be resolved today. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Observed behavior
Running
pytest
on the snippet below results in an error while attempting to construct the traceback.Details
This behavior was introduced in 1.0.3. It seems to assume that if the
name
attribute is set, theobj
attribute will be set as well. As far as I understand there are two issues with that assumption:name
andobj
attributes are only introduced in Python 3.10. In Python 3.9 and below it is perfectly valid to introduce a custom subclass that happens to have one or both of these names, which might have different meanings entirely than the ones defined in 3.10+.The second issue could be argued to be of lesser importance (and more difficult to address). The first I would call a breaking bug.
Environment
I'm using the latest versions of
pytest-7.2.0
andexceptiongroup-1.0.3
at the time of writing, but I believe olderpytest
versions are also susceptible to this issue.The text was updated successfully, but these errors were encountered: