]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] gh-94938: Fix errror detection of unexpected keyword arguments (GH-94999)...
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 28 Jul 2022 06:51:45 +0000 (09:51 +0300)
committerGitHub <noreply@github.com>
Thu, 28 Jul 2022 06:51:45 +0000 (09:51 +0300)
commit33efd7f7a3e3af172c93675d13d71916a3614b86
treed6b5b3ef6401f01cdea9aeb6aa3cec1cc4d4c88e
parent547f0bb82f6f96d2cd5ad5580d0508b1ac6e1957
[3.11] gh-94938: Fix errror detection of unexpected keyword arguments (GH-94999) (GH-95353)

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 ebad53a4dc1bb591820724a22cef9b8459185b5f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/test/test_call.py
Lib/test/test_getargs2.py
Misc/NEWS.d/next/Core and Builtins/2022-07-19-09-41-55.gh-issue-94938.xYBlM7.rst [new file with mode: 0644]
Python/getargs.c