Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-146075: Prevent crash in functools.partial() from malformed str subclass#146078

Merged
encukou merged 3 commits into
python:mainpython/cpython:mainfrom
brijkapadia:partial-containsbrijkapadia/cpython:partial-containsCopy head branch name to clipboard
Mar 18, 2026
Merged

gh-146075: Prevent crash in functools.partial() from malformed str subclass#146078
encukou merged 3 commits into
python:mainpython/cpython:mainfrom
brijkapadia:partial-containsbrijkapadia/cpython:partial-containsCopy head branch name to clipboard

Conversation

@brijkapadia

@brijkapadia brijkapadia commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

In partial_vectorcall, an error returned by PyDict_Contains was considered to be a truthy value. Now, the error is handled appropriately.

In `partial_vectorcall`, an error returned by `PyDict_Contains` was
considered to be a truthy value. Now, the error is handled
appropriately.
@StanFromIreland StanFromIreland changed the title gh-146075: Prevent crash from malformed str subclass gh-146075: Prevent crash in functools.partial() from malformed str subclass Mar 17, 2026

@skirpichev skirpichev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Test failures look unrelated.

@encukou encukou merged commit 6486211 into python:main Mar 18, 2026
93 of 99 checks passed
@brijkapadia brijkapadia deleted the partial-contains branch March 18, 2026 13:49
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
…d `str` subclass (pythonGH-146078)

In `partial_vectorcall`, an error returned by `PyDict_Contains` was
considered to be a truthy value. Now, the error is handled
appropriately.
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.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.