Skip to content
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

bpo-42006: Stop using PyDict_GetItem, PyDict_GetItemString and _PyDict_GetItemId. #22648

Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Oct 11, 2020

These functions are considered not safe because they suppress all internal errors and can return wrong result. PyDict_GetItemString and _PyDict_GetItemId can also silence current exception in rare cases.

https://bugs.python.org/issue42006

…t_GetItemId.

These functions are considered not safe because they suppress all internal errors
and can return wrong result.  PyDict_GetItemString and _PyDict_GetItemId can
also silence current exception in rare cases.
@serhiy-storchaka serhiy-storchaka force-pushed the capi-dont-use-PyDict_GetItem branch from e2cbee1 to cd49ec3 Compare Oct 11, 2020
@serhiy-storchaka serhiy-storchaka marked this pull request as ready for review Oct 24, 2020
Copy link
Member

@methane methane left a comment

LGTM.

@serhiy-storchaka serhiy-storchaka merged commit fb5db7e into python:master Oct 26, 2020
3 checks passed
@serhiy-storchaka serhiy-storchaka deleted the capi-dont-use-PyDict_GetItem branch Oct 26, 2020
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 13, 2021
…t_GetItemId. (pythonGH-22648)

These functions are considered not safe because they suppress all internal errors
and can return wrong result.  PyDict_GetItemString and _PyDict_GetItemId can
also silence current exception in rare cases.

Remove no longer used _PyDict_GetItemId.
Add _PyDict_ContainsId and rename _PyDict_Contains into
_PyDict_Contains_KnownHash.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants