8000 [3.12] gh-129573: Fix abort from non-string suggestions in `calculate_suggestions` by devdanzin · Pull Request #129574 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.12] gh-129573: Fix abort from non-string suggestions in calculate_suggestions #129574

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
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Check that suggestion candidates in calculate_suggestions are strings.
  • Loading branch information
devdanzin committed Feb 2, 2025
commit 8e821e72eb3c32fa4a6489fc9f777e8a41435cea
4 changes: 4 additions & 0 deletions Python/suggestions.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ calculate_suggestions(PyObject *dir,
}
for (int i = 0; i < dir_size; ++i) {
PyObject *item = PyList_GET_ITEM(dir, i);
if (!PyUnicode_Check(item)) {
PyMem_Free(buffer);
return NULL;
}
if (_PyUnicode_Equal(name, item)) {
continue;
}
Expand Down
0