-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
[3.12] Behavior change: __getattr__ gets called after property raises NotImplementedError #103551
Labels
type-bug
An unexpected behavior, bug, or error
Comments
Hi, @nicoddemus 👋 Please, try the latest |
Thanks! Indeed I tried on the latest main (2b6f5c3) and it now works the same as Python 3.11. Closing the issue then, thanks! |
Great, thanks for confirming! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
Version:
3.12.0a7
OS: Windows
While testing pytest in 3.12 on Windows, we noticed an odd behavior that we believe might be a bug/regression.
Consider this minimal example:
(Using
getattr(1, ...)
there just to have an object in-place; in the real code1
is actually another object, but the outcome is the same).Running this in Python
3.11.2
(and previous versions), we get this output:NotImplementedError
is raised from the property access, and__getattr__
is never called.In Python
3.12.0a7
however we get:The property is still being accessed (as shown by the
print
call), butNotImplementedError
is being swallowed/ignored, and__getattr__
seems to be getting called as a fallback.Changing the example slightly:
In Python
3.11
the behavior stays the same as before, however in Python3.12
we now get:Please let us know if you need more information.
The text was updated successfully, but these errors were encountered: