-
- Downloads
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.
Showing
- Lib/test/test_call.py 25 additions, 0 deletionsLib/test/test_call.py
- Lib/test/test_getargs2.py 27 additions, 0 deletionsLib/test/test_getargs2.py
- Misc/NEWS.d/next/Core and Builtins/2022-07-19-09-41-55.gh-issue-94938.xYBlM7.rst 3 additions, 0 deletions...nd Builtins/2022-07-19-09-41-55.gh-issue-94938.xYBlM7.rst
- Python/getargs.c 57 additions, 85 deletionsPython/getargs.c
Loading
Please register or sign in to comment