mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
gh-110815: Support non-ASCII keyword names in PyArg_ParseTupleAndKeywords() (GH-110816)
It already mostly worked, except in the case when invalid keyword argument with non-ASCII name was passed to function with non-ASCII parameter names. Then it crashed in the debug mode.
This commit is contained in:
parent
ce298a1c15
commit
7284e0ef84
5 changed files with 64 additions and 3 deletions
|
@ -416,8 +416,10 @@ API Functions
|
|||
.. c:function:: int PyArg_ParseTupleAndKeywords(PyObject *args, PyObject *kw, const char *format, char *keywords[], ...)
|
||||
|
||||
Parse the parameters of a function that takes both positional and keyword
|
||||
parameters into local variables. The *keywords* argument is a
|
||||
``NULL``-terminated array of keyword parameter names. Empty names denote
|
||||
parameters into local variables.
|
||||
The *keywords* argument is a ``NULL``-terminated array of keyword parameter
|
||||
names specified as null-terminated ASCII or UTF-8 encoded C strings.
|
||||
Empty names denote
|
||||
:ref:`positional-only parameters <positional-only_parameter>`.
|
||||
Returns true on success; on failure, it returns false and raises the
|
||||
appropriate exception.
|
||||
|
@ -426,6 +428,9 @@ API Functions
|
|||
Added support for :ref:`positional-only parameters
|
||||
<positional-only_parameter>`.
|
||||
|
||||
.. versionchanged:: 3.13
|
||||
Added support for non-ASCII keyword parameter names.
|
||||
|
||||
|
||||
.. c:function:: int PyArg_VaParseTupleAndKeywords(PyObject *args, PyObject *kw, const char *format, char *keywords[], va_list vargs)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue