mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-36346: Emit DeprecationWarning for PyArg_Parse() with 'u' or 'Z'. (GH-20927)
Emit DeprecationWarning when PyArg_Parse*() is called with 'u', 'Z' format. See PEP 623.
This commit is contained in:
parent
5a4aa4c03e
commit
91a639a094
4 changed files with 69 additions and 27 deletions
|
@ -1014,7 +1014,10 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
|
|||
case 'u': /* raw unicode buffer (Py_UNICODE *) */
|
||||
case 'Z': /* raw unicode buffer or None */
|
||||
{
|
||||
// TODO: Raise DeprecationWarning
|
||||
if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
|
||||
"getargs: The '%c' format is deprecated. Use 'U' instead.", c)) {
|
||||
return NULL;
|
||||
}
|
||||
_Py_COMP_DIAG_PUSH
|
||||
_Py_COMP_DIAG_IGNORE_DEPR_DECLS
|
||||
Py_UNICODE **p = va_arg(*p_va, Py_UNICODE **);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue