8000 gh-132171: Fix `_interpreters.run_string` crash on string subclass by sobolevn · Pull Request #132173 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-132171: Fix _interpreters.run_string crash on string subclass #132173

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

Merged
merged 1 commit into from
Apr 7, 2025

Conversation

sobolevn
Copy link
Member
@sobolevn sobolevn commented Apr 6, 2025

@sobolevn sobolevn added the needs backport to 3.13 bugs and security fixes label Apr 7, 2025
@sobolevn sobolevn merged commit 3980718 into python:main Apr 7, 2025
48 checks passed
@miss-islington-app
Copy link

Thanks @sobolevn for the PR 🌮🎉.. 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 8000 Apr 7, 2025
…ass (pythonGH-132173)

(cherry picked from commit 3980718)

Co-authored-by: sobolevn <mail@sobolevn.me>
@bedevere-app
Copy link
bedevere-app bot commented Apr 7, 2025

GH-132219 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 Apr 7, 2025
sobolevn added a commit that referenced this pull request Apr 7, 2025
…lass (GH-132173) (#132219)

gh-132171: Fix `_interpreters.run_string` crash on string subclass (GH-132173)
(cherry picked from commit 3980718)

Co-authored-by: sobolevn <mail@sobolevn.me>
@@ -330,7 +330,7 @@ get_code_str(PyObject *arg, Py_ssize_t *len_p, PyObject **bytes_p, int *flags_p)
int flags = 0;

if (PyUnicode_Check(arg)) {
assert(PyUnicode_CheckExact(arg)
assert(PyUnicode_Check(arg)
Copy link
Contributor

Choose a reason for hiding this comment

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

check is already happening in the if condition, then why do the check again? Shouldn't we remove it?

Copy link
Member

Choose a reason for hiding this comment

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

In hindsight, sure. But I don't think it's worth changing it now; it's not wrong, it's just redundant.

seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
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.

3 participants
0