Skip to content

Conversation

@sobolevn
Copy link
Member

@sobolevn sobolevn commented Nov 11, 2024

This was the cause:

  • We checked that passed arg is not a dict here:

    cpython/Python/crossinterp.c

    Lines 1479 to 1482 in 6ee542d

    if (!PyDict_CheckExact(nsobj)) {
    PyErr_SetString(PyExc_TypeError, "expected a dict");
    return NULL;
    }
  • Later we had an assertion about !PyErr_Occurred()

So, I went with the early validation.

@kumaraditya303 kumaraditya303 added the needs backport to 3.13 bugs and security fixes label Nov 11, 2024
@kumaraditya303 kumaraditya303 merged commit 9fc2808 into python:main Nov 11, 2024
47 checks passed
@miss-islington-app
Copy link

Thanks @sobolevn for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 11, 2024
@bedevere-app
Copy link

bedevere-app bot commented Nov 11, 2024

GH-126681 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Nov 11, 2024
kumaraditya303 pushed a commit that referenced this pull request Nov 11, 2024
…odule (GH-126678) (#126681)

gh-126654: Fix crash in several functions in `_interpreters` module (GH-126678)
(cherry picked from commit 9fc2808)

Co-authored-by: sobolevn <[email protected]>
picnixz pushed a commit to picnixz/cpython that referenced this pull request Dec 8, 2024
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants