-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
PyDict_GetItem and PyObject_HasAttr should not be used #106033
Labels
type-bug
An unexpected behavior, bug, or error
Comments
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this issue
Jun 23, 2023
…bject_HasAttr These functions are broken by design because they discard any exceptions raised inside, including MemoryError and KeyboardInterrupt. They should not be used in new code.
serhiy-storchaka
added a commit
that referenced
this issue
Jun 23, 2023
…HasAttr (GH-106034) These functions are broken by design because they discard any exceptions raised inside, including MemoryError and KeyboardInterrupt. They should not be used in new code.
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this issue
Jun 23, 2023
…and PyObject_HasAttr (pythonGH-106034) These functions are broken by design because they discard any exceptions raised inside, including MemoryError and KeyboardInterrupt. They should not be used in new code.. (cherry picked from commit 1d33d53) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This was referenced Jun 23, 2023
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this issue
Jun 23, 2023
…and PyObject_HasAttr (pythonGH-106034) These functions are broken by design because they discard any exceptions raised inside, including MemoryError and KeyboardInterrupt. They should not be used in new code. (cherry picked from commit 1d33d53) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka
added a commit
to serhiy-storchaka/cpython
that referenced
this issue
Jun 23, 2023
This was referenced Jun 23, 2023
gpshead
added a commit
that referenced
this issue
Jun 24, 2023
Use a note:: tag so that these dict and object API deficiencies show up clearly. A caution:: tag was considered, but our current python docs rendering doesn't do much with that (no box or color change). warning:: seemed too extreme. note looks good.
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jun 24, 2023
…nGH-106047) Use a note:: tag so that these dict and object API deficiencies show up clearly. A caution:: tag was considered, but our current python docs rendering doesn't do much with that (no box or color change). warning:: seemed too extreme. note looks good. (cherry picked from commit 19d6511) Co-authored-by: Gregory P. Smith <greg@krypto.org>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jun 24, 2023
…nGH-106047) Use a note:: tag so that these dict and object API deficiencies show up clearly. A caution:: tag was considered, but our current python docs rendering doesn't do much with that (no box or color change). warning:: seemed too extreme. note looks good. (cherry picked from commit 19d6511) Co-authored-by: Gregory P. Smith <greg@krypto.org>
gpshead
added a commit
that referenced
this issue
Jun 24, 2023
…06047) (#106071) gh-106033: [docs] Improve C API GetItem & HasAttr notes. (GH-106047) Use a note:: tag so that these dict and object API deficiencies show up clearly. A caution:: tag was considered, but our current python docs rendering doesn't do much with that (no box or color change). warning:: seemed too extreme. note looks good. (cherry picked from commit 19d6511) Co-authored-by: Gregory P. Smith <greg@krypto.org>
gpshead
added a commit
that referenced
this issue
Jun 24, 2023
…06047) (#106070) gh-106033: [docs] Improve C API GetItem & HasAttr notes. (GH-106047) Use a note:: tag so that these dict and object API deficiencies show up clearly. A caution:: tag was considered, but our current python docs rendering doesn't do much with that (no box or color change). warning:: seemed too extreme. note looks good. (cherry picked from commit 19d6511) Co-authored-by: Gregory P. Smith <greg@krypto.org>
gpshead
pushed a commit
that referenced
this issue
Jun 24, 2023
#106041) [3.12] gh-106033: Get rid of new occurrences of PyDict_GetItem and PyObject_HasAttr (GH-106034) These functions are broken by design because they discard any exceptions raised inside, including MemoryError and KeyboardInterrupt. They should not be used in new code. (cherry picked from commit 1d33d53)
gpshead
pushed a commit
that referenced
this issue
Jun 24, 2023
#106040) [3.11] gh-106033: Get rid of new occurrences of PyDict_GetItem and PyObject_HasAttr (GH-106034) These functions are broken by design because they discard any exceptions raised inside, including MemoryError and KeyboardInterrupt. They should not be used in new code.. (cherry picked from commit 1d33d53)
serhiy-storchaka
added a commit
that referenced
this issue
Jun 29, 2023
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jun 29, 2023
…ctor (pythonGH-106044) (cherry picked from commit 08c08d2) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka
added a commit
that referenced
this issue
Jun 29, 2023
See also #86172. |
See also the issue #106004: I propose adding PyDict_GetItemRef() function which doesn't have these flaws. |
Can this be closed, or do you expect more work here, @serhiy-storchaka? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
These functions are broken by design, because they discard any exceptions raised inside, including MemoryError and KeyboardInterrupt. There were several rounds of getting rid of them in past (for example 567eba1, #11112, #75753), but they occur in new code.
Linked PRs
The text was updated successfully, but these errors were encountered: