Skip to content

Outdated PyObject_HasAttr documentation (Exception behavior) #125887

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

Closed
sklam opened this issue Oct 23, 2024 · 1 comment · Fixed by #125907
Closed

Outdated PyObject_HasAttr documentation (Exception behavior) #125887

sklam opened this issue Oct 23, 2024 · 1 comment · Fixed by #125907
Labels
docs Documentation in the Doc dir easy topic-C-API

Comments

@sklam
Copy link

sklam commented Oct 23, 2024

Documentation

In Python 3.13, PyObject_HasAttr doc says:

Exceptions that occur when this calls __getattr__() and __getattribute__() methods are silently ignored.

But its exception behavior after #106674 is to report all exceptions other than AttributeError.

Linked PRs

@sklam sklam added the docs Documentation in the Doc dir label Oct 23, 2024
@ZeroIntensity
Copy link
Member

Well, it doesn't "report" exceptions, it displays an unraisable error. But yeah, I wouldn't call that silent. I guess it should be changed to something like "Exceptions that occur when this calls __getattr__() and __getattribute__() methods aren't propagated, but instead given to sys.unraisablehook." PR is welcome :)

hauntsaninja added a commit that referenced this issue Dec 27, 2024
Update PyObject_HasAttr exception behavior

Co-authored-by: Shantanu <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Dec 27, 2024
…-125907)

Update PyObject_HasAttr exception behavior

(cherry picked from commit 08a0728)

Co-authored-by: Damien <[email protected]>
Co-authored-by: Shantanu <[email protected]>
hauntsaninja added a commit that referenced this issue Dec 27, 2024
…) (#128283)

gh-125887: Update PyObject_HasAttr exception behavior (GH-125907)

Update PyObject_HasAttr exception behavior

(cherry picked from commit 08a0728)

Co-authored-by: Damien <[email protected]>
Co-authored-by: Shantanu <[email protected]>
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this issue Jan 8, 2025
…25907)

Update PyObject_HasAttr exception behavior

Co-authored-by: Shantanu <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir easy topic-C-API
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

2 participants