8000 [3.10] gh-94938: Fix errror detection of unexpected keyword arguments… by serhiy-storchaka · Pull Request #95354 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@serhiy-storchaka
Copy link
Member
@serhiy-storchaka serhiy-storchaka commented Jul 28, 2022

… (GH-94999)

When keyword argument name is an instance of a str subclass with
overloaded methods eq and hash, the former code could not find
the name of an extraneous keyword argument to report an error, and
_PyArg_UnpackKeywords() returned success without setting the
corresponding cell in the linearized arguments array. But since the number
of expected initialized cells is determined as the total number of passed
arguments, this lead to reading NULL as a keyword parameter value, that
caused SystemError or crash or other undesired behavior..
(cherry picked from commit ebad53a)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com

…uments (pythonGH-94999)

When keyword argument name is an instance of a str subclass with
overloaded methods __eq__ and __hash__, the former code could not find
the name of an extraneous keyword argument to report an error, and
_PyArg_UnpackKeywords() returned success without setting the
corresponding cell in the linearized arguments array. But since the number
of expected initialized cells is determined as the total number of passed
arguments, this lead to reading NULL as a keyword parameter value, that
caused SystemError or crash or other undesired behavior..
(cherry picked from commit ebad53a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-bot bedevere-bot added type-bug An unexpected behavior, bug, or error awaiting core review labels Jul 28, 2022
@serhiy-storchaka serhiy-storchaka merged commit 563f058 into python:3.10 Jul 28, 2022
@serhiy-storchaka serhiy-storchaka deleted the backport-ebad53a-3.10 branch July 28, 2022 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0