diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2022-07-28 04:40:36 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-28 04:40:36 (GMT) |
commit | ebad53a4dc1bb591820724a22cef9b8459185b5f (patch) | |
tree | fa878ab07860517d3ace9ee9ef8ed8ef998a2415 /Misc/NEWS.d | |
parent | 0fe645d6fd22a6f57e777a29e65cf9a4ff9785ae (diff) | |
download | cpython-ebad53a4dc1bb591820724a22cef9b8459185b5f.zip cpython-ebad53a4dc1bb591820724a22cef9b8459185b5f.tar.gz cpython-ebad53a4dc1bb591820724a22cef9b8459185b5f.tar.bz2 |
gh-94938: Fix errror detection of unexpected keyword arguments (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.
Diffstat (limited to 'Misc/NEWS.d')
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2022-07-19-09-41-55.gh-issue-94938.xYBlM7.rst | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-07-19-09-41-55.gh-issue-94938.xYBlM7.rst b/Misc/NEWS.d/next/Core and Builtins/2022-07-19-09-41-55.gh-issue-94938.xYBlM7.rst new file mode 100644 index 0000000..cc4feae --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2022-07-19-09-41-55.gh-issue-94938.xYBlM7.rst @@ -0,0 +1,3 @@ +Fix error detection in some builtin functions when keyword argument name is +an instance of a str subclass with overloaded ``__eq__`` and ``__hash__``. +Previously it could cause SystemError or other undesired behavior. |