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 October 11, 2020 15:41
@serhiy-storchaka serhiy-storchaka marked this pull request as ready for review October 24, 2020 17:55
Copy link
Member

@methane methane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@serhiy-storchaka serhiy-storchaka merged commit fb5db7e into python:master Oct 26, 2020
@serhiy-storchaka serhiy-storchaka deleted the capi-dont-use-PyDict_GetItem branch October 26, 2020 06:43
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.

4 participants