From 21ee10ee3207105183f0408653b3f81bd4a9bc21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Lapeyre?= Date: Mon, 27 May 2019 15:46:07 +0200 Subject: [PATCH 01/15] Add test for displaying argument name on errors with keyword arguments --- Lib/test/clinic.test | 55 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/Lib/test/clinic.test b/Lib/test/clinic.test index 62c2f00c6b2b98..a061069ead641a 100644 --- a/Lib/test/clinic.test +++ b/Lib/test/clinic.test @@ -3195,3 +3195,58 @@ test_posonly_opt_keywords_opt_kwonly_opt_impl(PyObject *module, PyObject *a, PyObject *d, PyObject *e, PyObject *f) /*[clinic end generated code: output=719e4f6c224402d4 input=9914857713c5bbf8]*/ + +/*[clinic input] +test_posonly_opt_keywords_opt_kwonly_opt + + + * + co_lnotab: PyBytesObject(c_default="(PyBytesObject *)self->co_lnotab") = None + +[clinic start generated code]*/ + +PyDoc_STRVAR(test_posonly_opt_keywords_opt_kwonly_opt__doc__, +"test_posonly_opt_keywords_opt_kwonly_opt($module, /, *, co_lnotab=None)\n" +"--\n" +"\n"); + +#define TEST_POSONLY_OPT_KEYWORDS_OPT_KWONLY_OPT_METHODDEF \ + {"test_posonly_opt_keywords_opt_kwonly_opt", (PyCFunction)(void(*)(void))test_posonly_opt_keywords_opt_kwonly_opt, METH_FASTCALL|METH_KEYWORDS, test_posonly_opt_keywords_opt_kwonly_opt__doc__}, + +static PyObject * +test_posonly_opt_keywords_opt_kwonly_opt_impl(PyObject *module, + PyBytesObject *co_lnotab); + +static PyObject * +test_posonly_opt_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) +{ + PyObject *return_value = NULL; + static const char * const _keywords[] = {"co_lnotab", NULL}; + static _PyArg_Parser _parser = {NULL, _keywords, "test_posonly_opt_keywords_opt_kwonly_opt", 0}; + PyObject *argsbuf[1]; + Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0; + PyBytesObject *co_lnotab = (PyBytesObject *)self->co_lnotab; + + args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, argsbuf); + if (!args) { + goto exit; + } + if (!noptargs) { + goto skip_optional_kwonly; + } + if (!PyBytes_Check(args[0])) { + _PyArg_BadArgument("test_posonly_opt_keywords_opt_kwonly_opt", "'co_lnotab'", "bytes", args[0]); + goto exit; + } + co_lnotab = (PyBytesObject *)args[0]; +skip_optional_kwonly: + return_value = test_posonly_opt_keywords_opt_kwonly_opt_impl(module, co_lnotab); + +exit: + return return_value; +} + +static PyObject * +test_posonly_opt_keywords_opt_kwonly_opt_impl(PyObject *module, + PyBytesObject *co_lnotab) +/*[clinic end generated code: output=f898e97c2ddd2f0e input=e7b42af17f2a55ec]*/ From b5750906a55ea5247b138ffbdf811984be76e2ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Lapeyre?= Date: Mon, 27 May 2019 16:05:50 +0200 Subject: [PATCH 02/15] Display argument name on errors with keyword arguments --- Lib/test/clinic.test | 82 +++++++++++++++++++++--------------------- Tools/clinic/clinic.py | 38 ++++++++++---------- 2 files changed, 61 insertions(+), 59 deletions(-) diff --git a/Lib/test/clinic.test b/Lib/test/clinic.test index a061069ead641a..08462236478bff 100644 --- a/Lib/test/clinic.test +++ b/Lib/test/clinic.test @@ -44,7 +44,7 @@ test_object_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("test_object_converter", 3, "str", args[2]); + _PyArg_BadArgument("test_object_converter", "3", "str", args[2]); goto exit; } c = args[2]; @@ -58,7 +58,7 @@ exit: static PyObject * test_object_converter_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c, PyUnicode_Object *d) -/*[clinic end generated code: output=f2c26174b3d46e94 input=005e6a8a711a869b]*/ +/*[clinic end generated code: output=330a33c7fa1cb1d2 input=005e6a8a711a869b]*/ /*[clinic input] @@ -180,52 +180,52 @@ test_object_converter_subclass_of(PyObject *module, PyObject *const *args, Py_ss goto exit; } if (!PyLong_Check(args[0])) { - _PyArg_BadArgument("test_object_converter_subclass_of", 1, "int", args[0]); + _PyArg_BadArgument("test_object_converter_subclass_of", "1", "int", args[0]); goto exit; } a = args[0]; if (!PyTuple_Check(args[1])) { - _PyArg_BadArgument("test_object_converter_subclass_of", 2, "tuple", args[1]); + _PyArg_BadArgument("test_object_converter_subclass_of", "2", "tuple", args[1]); goto exit; } b = args[1]; if (!PyList_Check(args[2])) { - _PyArg_BadArgument("test_object_converter_subclass_of", 3, "list", args[2]); + _PyArg_BadArgument("test_object_converter_subclass_of", "3", "list", args[2]); goto exit; } c = args[2]; if (!PySet_Check(args[3])) { - _PyArg_BadArgument("test_object_converter_subclass_of", 4, "set", args[3]); + _PyArg_BadArgument("test_object_converter_subclass_of", "4", "set", args[3]); goto exit; } d = args[3]; if (!PyFrozenSet_Check(args[4])) { - _PyArg_BadArgument("test_object_converter_subclass_of", 5, "frozenset", args[4]); + _PyArg_BadArgument("test_object_converter_subclass_of", "5", "frozenset", args[4]); goto exit; } e = args[4]; if (!PyDict_Check(args[5])) { - _PyArg_BadArgument("test_object_converter_subclass_of", 6, "dict", args[5]); + _PyArg_BadArgument("test_object_converter_subclass_of", "6", "dict", args[5]); goto exit; } f = args[5]; if (!PyUnicode_Check(args[6])) { - _PyArg_BadArgument("test_object_converter_subclass_of", 7, "str", args[6]); + _PyArg_BadArgument("test_object_converter_subclass_of", "7", "str", args[6]); goto exit; } g = args[6]; if (!PyBytes_Check(args[7])) { - _PyArg_BadArgument("test_object_converter_subclass_of", 8, "bytes", args[7]); + _PyArg_BadArgument("test_object_converter_subclass_of", "8", "bytes", args[7]); goto exit; } h = args[7]; if (!PyByteArray_Check(args[8])) { - _PyArg_BadArgument("test_object_converter_subclass_of", 9, "bytearray", args[8]); + _PyArg_BadArgument("test_object_converter_subclass_of", "9", "bytearray", args[8]); goto exit; } i = args[8]; if (!PyObject_TypeCheck(args[9], &MyType)) { - _PyArg_BadArgument("test_object_converter_subclass_of", 10, (&MyType)->tp_name, args[9]); + _PyArg_BadArgument("test_object_converter_subclass_of", "10", (&MyType)->tp_name, args[9]); goto exit; } j = args[9]; @@ -240,7 +240,7 @@ test_object_converter_subclass_of_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c, PyObject *d, PyObject *e, PyObject *f, PyObject *g, PyObject *h, PyObject *i, PyObject *j) -/*[clinic end generated code: output=99691bda8eeda6d6 input=31b06b772d5f983e]*/ +/*[clinic end generated code: output=b78cace6b03450c5 input=31b06b772d5f983e]*/ /*[clinic input] @@ -269,7 +269,7 @@ test_PyBytesObject_converter(PyObject *module, PyObject *arg) PyBytesObject *a; if (!PyBytes_Check(arg)) { - _PyArg_BadArgument("test_PyBytesObject_converter", 0, "bytes", arg); + _PyArg_BadArgument("test_PyBytesObject_converter", "0", "bytes", arg); goto exit; } a = (PyBytesObject *)arg; @@ -281,7 +281,7 @@ exit: static PyObject * test_PyBytesObject_converter_impl(PyObject *module, PyBytesObject *a) -/*[clinic end generated code: output=5d9a301c1df24eb5 input=12b10c7cb5750400]*/ +/*[clinic end generated code: output=19f9031800e64238 input=12b10c7cb5750400]*/ /*[clinic input] @@ -310,7 +310,7 @@ test_PyByteArrayObject_converter(PyObject *module, PyObject *arg) PyByteArrayObject *a; if (!PyByteArray_Check(arg)) { - _PyArg_BadArgument("test_PyByteArrayObject_converter", 0, "bytearray", arg); + _PyArg_BadArgument("test_PyByteArrayObject_converter", "0", "bytearray", arg); goto exit; } a = (PyByteArrayObject *)arg; @@ -322,7 +322,7 @@ exit: static PyObject * test_PyByteArrayObject_converter_impl(PyObject *module, PyByteArrayObject *a) -/*[clinic end generated code: output=9455d06f4f09637b input=5a657da535d194ae]*/ +/*[clinic end generated code: output=1b4c1a61d2f16b59 input=5a657da535d194ae]*/ /*[clinic input] @@ -351,7 +351,7 @@ test_unicode_converter(PyObject *module, PyObject *arg) PyObject *a; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("test_unicode_converter", 0, "str", arg); + _PyArg_BadArgument("test_unicode_converter", "0", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -366,7 +366,7 @@ exit: static PyObject * test_unicode_converter_impl(PyObject *module, PyObject *a) -/*[clinic end generated code: output=9275c04fe204f4c5 input=aa33612df92aa9c5]*/ +/*[clinic end generated code: output=42cfac01ad013002 input=aa33612df92aa9c5]*/ /*[clinic input] @@ -507,7 +507,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) a = PyByteArray_AS_STRING(args[0])[0]; } else { - _PyArg_BadArgument("test_char_converter", 1, "a byte string of length 1", args[0]); + _PyArg_BadArgument("test_char_converter", "1", "a byte string of length 1", args[0]); goto exit; } if (nargs < 2) { @@ -520,7 +520,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) b = PyByteArray_AS_STRING(args[1])[0]; } else { - _PyArg_BadArgument("test_char_converter", 2, "a byte string of length 1", args[1]); + _PyArg_BadArgument("test_char_converter", "2", "a byte string of length 1", args[1]); goto exit; } if (nargs < 3) { @@ -533,7 +533,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) c = PyByteArray_AS_STRING(args[2])[0]; } else { - _PyArg_BadArgument("test_char_converter", 3, "a byte string of length 1", args[2]); + _PyArg_BadArgument("test_char_converter", "3", "a byte string of length 1", args[2]); goto exit; } if (nargs < 4) { @@ -546,7 +546,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) d = PyByteArray_AS_STRING(args[3])[0]; } else { - _PyArg_BadArgument("test_char_converter", 4, "a byte string of length 1", args[3]); + _PyArg_BadArgument("test_char_converter", "4", "a byte string of length 1", args[3]); goto exit; } if (nargs < 5) { @@ -559,7 +559,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) e = PyByteArray_AS_STRING(args[4])[0]; } else { - _PyArg_BadArgument("test_char_converter", 5, "a byte string of length 1", args[4]); + _PyArg_BadArgument("test_char_converter", "5", "a byte string of length 1", args[4]); goto exit; } if (nargs < 6) { @@ -572,7 +572,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) f = PyByteArray_AS_STRING(args[5])[0]; } else { - _PyArg_BadArgument("test_char_converter", 6, "a byte string of length 1", args[5]); + _PyArg_BadArgument("test_char_converter", "6", "a byte string of length 1", args[5]); goto exit; } if (nargs < 7) { @@ -585,7 +585,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) g = PyByteArray_AS_STRING(args[6])[0]; } else { - _PyArg_BadArgument("test_char_converter", 7, "a byte string of length 1", args[6]); + _PyArg_BadArgument("test_char_converter", "7", "a byte string of length 1", args[6]); goto exit; } if (nargs < 8) { @@ -598,7 +598,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) h = PyByteArray_AS_STRING(args[7])[0]; } else { - _PyArg_BadArgument("test_char_converter", 8, "a byte string of length 1", args[7]); + _PyArg_BadArgument("test_char_converter", "8", "a byte string of length 1", args[7]); goto exit; } if (nargs < 9) { @@ -611,7 +611,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) i = PyByteArray_AS_STRING(args[8])[0]; } else { - _PyArg_BadArgument("test_char_converter", 9, "a byte string of length 1", args[8]); + _PyArg_BadArgument("test_char_converter", "9", "a byte string of length 1", args[8]); goto exit; } if (nargs < 10) { @@ -624,7 +624,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) j = PyByteArray_AS_STRING(args[9])[0]; } else { - _PyArg_BadArgument("test_char_converter", 10, "a byte string of length 1", args[9]); + _PyArg_BadArgument("test_char_converter", "10", "a byte string of length 1", args[9]); goto exit; } if (nargs < 11) { @@ -637,7 +637,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) k = PyByteArray_AS_STRING(args[10])[0]; } else { - _PyArg_BadArgument("test_char_converter", 11, "a byte string of length 1", args[10]); + _PyArg_BadArgument("test_char_converter", "11", "a byte string of length 1", args[10]); goto exit; } if (nargs < 12) { @@ -650,7 +650,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) l = PyByteArray_AS_STRING(args[11])[0]; } else { - _PyArg_BadArgument("test_char_converter", 12, "a byte string of length 1", args[11]); + _PyArg_BadArgument("test_char_converter", "12", "a byte string of length 1", args[11]); goto exit; } if (nargs < 13) { @@ -663,7 +663,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) m = PyByteArray_AS_STRING(args[12])[0]; } else { - _PyArg_BadArgument("test_char_converter", 13, "a byte string of length 1", args[12]); + _PyArg_BadArgument("test_char_converter", "13", "a byte string of length 1", args[12]); goto exit; } if (nargs < 14) { @@ -676,7 +676,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) n = PyByteArray_AS_STRING(args[13])[0]; } else { - _PyArg_BadArgument("test_char_converter", 14, "a byte string of length 1", args[13]); + _PyArg_BadArgument("test_char_converter", "14", "a byte string of length 1", args[13]); goto exit; } skip_optional: @@ -690,7 +690,7 @@ static PyObject * test_char_converter_impl(PyObject *module, char a, char b, char c, char d, char e, char f, char g, char h, char i, char j, char k, char l, char m, char n) -/*[clinic end generated code: output=e041d687555e0a5d input=e42330417a44feac]*/ +/*[clinic end generated code: output=a2beab3f9300b7b1 input=e42330417a44feac]*/ /*[clinic input] @@ -1009,14 +1009,14 @@ test_int_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("test_int_converter", 3, "a unicode character", args[2]); + _PyArg_BadArgument("test_int_converter", "3", "a unicode character", args[2]); goto exit; } if (PyUnicode_READY(args[2])) { goto exit; } if (PyUnicode_GET_LENGTH(args[2]) != 1) { - _PyArg_BadArgument("test_int_converter", 3, "a unicode character", args[2]); + _PyArg_BadArgument("test_int_converter", "3", "a unicode character", args[2]); goto exit; } c = PyUnicode_READ_CHAR(args[2], 0); @@ -1041,7 +1041,7 @@ exit: static PyObject * test_int_converter_impl(PyObject *module, int a, int b, int c, myenum d) -/*[clinic end generated code: output=de74e24e85a669a5 input=d20541fc1ca0553e]*/ +/*[clinic end generated code: output=05acde55329aed6b input=d20541fc1ca0553e]*/ /*[clinic input] @@ -1215,7 +1215,7 @@ test_unsigned_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t goto skip_optional; } if (!PyLong_Check(args[2])) { - _PyArg_BadArgument("test_unsigned_long_converter", 3, "int", args[2]); + _PyArg_BadArgument("test_unsigned_long_converter", "3", "int", args[2]); goto exit; } c = PyLong_AsUnsignedLongMask(args[2]); @@ -1229,7 +1229,7 @@ exit: static PyObject * test_unsigned_long_converter_impl(PyObject *module, unsigned long a, unsigned long b, unsigned long c) -/*[clinic end generated code: output=1c05c871c0309e08 input=f450d94cae1ef73b]*/ +/*[clinic end generated code: output=96283dbd617a0e9e input=f450d94cae1ef73b]*/ /*[clinic input] @@ -1335,7 +1335,7 @@ test_unsigned_long_long_converter(PyObject *module, PyObject *const *args, Py_ss goto skip_optional; } if (!PyLong_Check(args[2])) { - _PyArg_BadArgument("test_unsigned_long_long_converter", 3, "int", args[2]); + _PyArg_BadArgument("test_unsigned_long_long_converter", "3", "int", args[2]); goto exit; } c = PyLong_AsUnsignedLongLongMask(args[2]); @@ -1351,7 +1351,7 @@ test_unsigned_long_long_converter_impl(PyObject *module, unsigned long long a, unsigned long long b, unsigned long long c) -/*[clinic end generated code: output=0a9b17fb824e28eb input=a15115dc41866ff4]*/ +/*[clinic end generated code: output=21859dd0bd80862a input=a15115dc41866ff4]*/ /*[clinic input] diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index cb2ded4649dce2..f6f8704ba6448f 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -851,7 +851,8 @@ def parser_body(prototype, *fields, declarations=''): """ % (nargs, min_pos, max_pos), indent=4)] has_optional = False for i, p in enumerate(parameters): - parsearg = p.converter.parse_arg(argname_fmt % i, i + 1) + argnum = repr(p.name) if p.is_keyword_only() else str(i + 1) + parsearg = p.converter.parse_arg(argname_fmt % i, argnum) if parsearg is None: #print('Cannot convert %s %r for %s' % (p.converter.__class__.__name__, p.converter.format_unit, p.converter.name), file=sys.stderr) parser_code = None @@ -927,7 +928,8 @@ def parser_body(prototype, *fields, declarations=''): add_label = None for i, p in enumerate(parameters): - parsearg = p.converter.parse_arg(argname_fmt % i, i + 1) + argnum = repr(p.name) if p.is_keyword_only() else str(i + 1) + parsearg = p.converter.parse_arg(argname_fmt % i, argnum) if parsearg is None: #print('Cannot convert %s %r for %s' % (p.converter.__class__.__name__, p.converter.format_unit, p.converter.name), file=sys.stderr) parser_code = None @@ -2648,7 +2650,7 @@ def parse_arg(self, argname, argnum): typecheck, typename = type_checks[self.subclass_of] return """ if (!{typecheck}({argname})) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, "{typename}", {argname}); + _PyArg_BadArgument("{{name}}", "{argnum}", "{typename}", {argname}); goto exit; }}}} {paramname} = {cast}{argname}; @@ -2657,7 +2659,7 @@ def parse_arg(self, argname, argnum): typecheck=typecheck, typename=typename, cast=cast) return """ if (!PyObject_TypeCheck({argname}, {subclass_of})) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, ({subclass_of})->tp_name, {argname}); + _PyArg_BadArgument("{{name}}", "{argnum}", ({subclass_of})->tp_name, {argname}); goto exit; }}}} {paramname} = {cast}{argname}; @@ -2747,7 +2749,7 @@ def parse_arg(self, argname, argnum): {paramname} = PyByteArray_AS_STRING({argname})[0]; }}}} else {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, "a byte string of length 1", {argname}); + _PyArg_BadArgument("{{name}}", "{argnum}", "a byte string of length 1", {argname}); goto exit; }}}} """.format(argname=argname, paramname=self.name, argnum=argnum) @@ -2907,14 +2909,14 @@ def parse_arg(self, argname, argnum): elif self.format_unit == 'C': return """ if (!PyUnicode_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, "a unicode character", {argname}); + _PyArg_BadArgument("{{name}}", "{argnum}", "a unicode character", {argname}); goto exit; }}}} if (PyUnicode_READY({argname})) {{{{ goto exit; }}}} if (PyUnicode_GET_LENGTH({argname}) != 1) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, "a unicode character", {argname}); + _PyArg_BadArgument("{{name}}", "{argnum}", "a unicode character", {argname}); goto exit; }}}} {paramname} = PyUnicode_READ_CHAR({argname}, 0); @@ -2983,7 +2985,7 @@ def parse_arg(self, argname, argnum): if self.format_unit == 'k': return """ if (!PyLong_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, "int", {argname}); + _PyArg_BadArgument("{{name}}", "{argnum}", "int", {argname}); goto exit; }}}} {paramname} = PyLong_AsUnsignedLongMask({argname}); @@ -3026,7 +3028,7 @@ def parse_arg(self, argname, argnum): if self.format_unit == 'K': return """ if (!PyLong_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, "int", {argname}); + _PyArg_BadArgument("{{name}}", "{argnum}", "int", {argname}); goto exit; }}}} {paramname} = PyLong_AsUnsignedLongLongMask({argname}); @@ -3214,7 +3216,7 @@ def parse_arg(self, argname, argnum): if self.format_unit == 's': return """ if (!PyUnicode_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, "str", {argname}); + _PyArg_BadArgument("{{name}}", "{argnum}", "str", {argname}); goto exit; }}}} Py_ssize_t {paramname}_length; @@ -3244,7 +3246,7 @@ def parse_arg(self, argname, argnum): }}}} }}}} else {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, "str or None", {argname}); + _PyArg_BadArgument("{{name}}", "{argnum}", "str or None", {argname}); goto exit; }}}} """.format(argname=argname, paramname=self.name, argnum=argnum) @@ -3307,7 +3309,7 @@ def parse_arg(self, argname, argnum): if self.format_unit == 'S': return """ if (!PyBytes_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, "bytes", {argname}); + _PyArg_BadArgument("{{name}}", "{argnum}", "bytes", {argname}); goto exit; }}}} {paramname} = ({type}){argname}; @@ -3324,7 +3326,7 @@ def parse_arg(self, argname, argnum): if self.format_unit == 'Y': return """ if (!PyByteArray_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, "bytearray", {argname}); + _PyArg_BadArgument("{{name}}", "{argnum}", "bytearray", {argname}); goto exit; }}}} {paramname} = ({type}){argname}; @@ -3341,7 +3343,7 @@ def parse_arg(self, argname, argnum): if self.format_unit == 'U': return """ if (!PyUnicode_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, "str", {argname}); + _PyArg_BadArgument("{{name}}", "{argnum}", "str", {argname}); goto exit; }}}} if (PyUnicode_READY({argname}) == -1) {{{{ @@ -3405,7 +3407,7 @@ def parse_arg(self, argname, argnum): goto exit; }}}} if (!PyBuffer_IsContiguous(&{paramname}, 'C')) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, "contiguous buffer", {argname}); + _PyArg_BadArgument("{{name}}", "{argnum}", "contiguous buffer", {argname}); goto exit; }}}} """.format(argname=argname, paramname=self.name, argnum=argnum) @@ -3424,7 +3426,7 @@ def parse_arg(self, argname, argnum): goto exit; }}}} if (!PyBuffer_IsContiguous(&{paramname}, 'C')) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, "contiguous buffer", {argname}); + _PyArg_BadArgument("{{name}}", "{argnum}", "contiguous buffer", {argname}); goto exit; }}}} }}}} @@ -3433,11 +3435,11 @@ def parse_arg(self, argname, argnum): return """ if (PyObject_GetBuffer({argname}, &{paramname}, PyBUF_WRITABLE) < 0) {{{{ PyErr_Clear(); - _PyArg_BadArgument("{{name}}", {argnum}, "read-write bytes-like object", {argname}); + _PyArg_BadArgument("{{name}}", "{argnum}", "read-write bytes-like object", {argname}); goto exit; }}}} if (!PyBuffer_IsContiguous(&{paramname}, 'C')) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, "contiguous buffer", {argname}); + _PyArg_BadArgument("{{name}}", "{argnum}", "contiguous buffer", {argname}); goto exit; }}}} """.format(argname=argname, paramname=self.name, argnum=argnum) From b76fdc831f8ed9273fbbc28acd8152160e30d7d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Lapeyre?= Date: Mon, 27 May 2019 16:06:01 +0200 Subject: [PATCH 03/15] Regen all clinic files --- Include/modsupport.h | 2 +- Modules/_blake2/clinic/blake2b_impl.c.h | 8 +- Modules/_blake2/clinic/blake2s_impl.c.h | 8 +- Modules/_io/clinic/_iomodule.c.h | 12 +- Modules/_io/clinic/bufferedio.c.h | 20 +-- Modules/_io/clinic/bytesio.c.h | 6 +- Modules/_io/clinic/fileio.c.h | 10 +- Modules/_io/clinic/textio.c.h | 8 +- Modules/_io/clinic/winconsoleio.c.h | 10 +- .../_multiprocessing/clinic/posixshmem.c.h | 6 +- Modules/cjkcodecs/clinic/multibytecodec.c.h | 14 +- Modules/clinic/_bz2module.c.h | 6 +- Modules/clinic/_codecsmodule.c.h | 168 +++++++++--------- Modules/clinic/_cryptmodule.c.h | 6 +- Modules/clinic/_curses_panel.c.h | 6 +- Modules/clinic/_cursesmodule.c.h | 14 +- Modules/clinic/_dbmmodule.c.h | 6 +- Modules/clinic/_elementtree.c.h | 12 +- Modules/clinic/_gdbmmodule.c.h | 6 +- Modules/clinic/_hashopenssl.c.h | 24 +-- Modules/clinic/_lzmamodule.c.h | 8 +- Modules/clinic/_pickle.c.h | 14 +- Modules/clinic/_sre.c.h | 8 +- Modules/clinic/_ssl.c.h | 28 +-- Modules/clinic/_struct.c.h | 10 +- Modules/clinic/_tkinter.c.h | 30 ++-- Modules/clinic/_weakref.c.h | 4 +- Modules/clinic/arraymodule.c.h | 10 +- Modules/clinic/audioop.c.h | 60 +++---- Modules/clinic/binascii.c.h | 22 +-- Modules/clinic/grpmodule.c.h | 4 +- Modules/clinic/itertoolsmodule.c.h | 6 +- Modules/clinic/mathmodule.c.h | 6 +- Modules/clinic/posixmodule.c.h | 16 +- Modules/clinic/pwdmodule.c.h | 4 +- Modules/clinic/pyexpat.c.h | 12 +- Modules/clinic/signalmodule.c.h | 4 +- Modules/clinic/spwdmodule.c.h | 4 +- Modules/clinic/symtablemodule.c.h | 6 +- Modules/clinic/unicodedata.c.h | 50 +++--- Modules/clinic/zlibmodule.c.h | 16 +- Objects/clinic/bytearrayobject.c.h | 16 +- Objects/clinic/bytesobject.c.h | 20 +-- Objects/clinic/codeobject.c.h | 20 +-- Objects/clinic/floatobject.c.h | 10 +- Objects/clinic/funcobject.c.h | 6 +- Objects/clinic/longobject.c.h | 8 +- Objects/clinic/moduleobject.c.h | 4 +- Objects/clinic/typeobject.c.h | 4 +- Objects/clinic/unicodeobject.c.h | 16 +- Objects/stringlib/clinic/transmogrify.h.h | 8 +- PC/clinic/_testconsole.c.h | 4 +- PC/clinic/msvcrtmodule.c.h | 14 +- Python/clinic/bltinmodule.c.h | 6 +- Python/clinic/import.c.h | 18 +- Python/clinic/marshal.c.h | 4 +- Python/clinic/sysmodule.c.h | 6 +- Python/clinic/traceback.c.h | 4 +- Python/getargs.c | 8 +- 59 files changed, 425 insertions(+), 425 deletions(-) diff --git a/Include/modsupport.h b/Include/modsupport.h index 66a5ec839e2a7f..f90ede4831e32b 100644 --- a/Include/modsupport.h +++ b/Include/modsupport.h @@ -66,7 +66,7 @@ PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args); #define _PyArg_NoPositional(funcname, args) \ ((args) == NULL || _PyArg_NoPositional((funcname), (args))) -PyAPI_FUNC(void) _PyArg_BadArgument(const char *, int, const char *, PyObject *); +PyAPI_FUNC(void) _PyArg_BadArgument(const char *, const char *, const char *, PyObject *); PyAPI_FUNC(int) _PyArg_CheckPositional(const char *, Py_ssize_t, Py_ssize_t, Py_ssize_t); #define _PyArg_CheckPositional(funcname, nargs, min, max) \ diff --git a/Modules/_blake2/clinic/blake2b_impl.c.h b/Modules/_blake2/clinic/blake2b_impl.c.h index 09fe00457f352d..ec67d885811b74 100644 --- a/Modules/_blake2/clinic/blake2b_impl.c.h +++ b/Modules/_blake2/clinic/blake2b_impl.c.h @@ -72,7 +72,7 @@ py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&key, 'C')) { - _PyArg_BadArgument("blake2b", 3, "contiguous buffer", fastargs[2]); + _PyArg_BadArgument("blake2b", "'key'", "contiguous buffer", fastargs[2]); goto exit; } if (!--noptargs) { @@ -84,7 +84,7 @@ py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&salt, 'C')) { - _PyArg_BadArgument("blake2b", 4, "contiguous buffer", fastargs[3]); + _PyArg_BadArgument("blake2b", "'salt'", "contiguous buffer", fastargs[3]); goto exit; } if (!--noptargs) { @@ -96,7 +96,7 @@ py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&person, 'C')) { - _PyArg_BadArgument("blake2b", 5, "contiguous buffer", fastargs[4]); + _PyArg_BadArgument("blake2b", "'person'", "contiguous buffer", fastargs[4]); goto exit; } if (!--noptargs) { @@ -261,4 +261,4 @@ _blake2_blake2b_hexdigest(BLAKE2bObject *self, PyObject *Py_UNUSED(ignored)) { return _blake2_blake2b_hexdigest_impl(self); } -/*[clinic end generated code: output=a91d182ce1109f34 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b029b6e555794580 input=a9049054013a1b77]*/ diff --git a/Modules/_blake2/clinic/blake2s_impl.c.h b/Modules/_blake2/clinic/blake2s_impl.c.h index 92739a1feb321e..acdf91cd78029d 100644 --- a/Modules/_blake2/clinic/blake2s_impl.c.h +++ b/Modules/_blake2/clinic/blake2s_impl.c.h @@ -72,7 +72,7 @@ py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&key, 'C')) { - _PyArg_BadArgument("blake2s", 3, "contiguous buffer", fastargs[2]); + _PyArg_BadArgument("blake2s", "'key'", "contiguous buffer", fastargs[2]); goto exit; } if (!--noptargs) { @@ -84,7 +84,7 @@ py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&salt, 'C')) { - _PyArg_BadArgument("blake2s", 4, "contiguous buffer", fastargs[3]); + _PyArg_BadArgument("blake2s", "'salt'", "contiguous buffer", fastargs[3]); goto exit; } if (!--noptargs) { @@ -96,7 +96,7 @@ py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&person, 'C')) { - _PyArg_BadArgument("blake2s", 5, "contiguous buffer", fastargs[4]); + _PyArg_BadArgument("blake2s", "'person'", "contiguous buffer", fastargs[4]); goto exit; } if (!--noptargs) { @@ -261,4 +261,4 @@ _blake2_blake2s_hexdigest(BLAKE2sObject *self, PyObject *Py_UNUSED(ignored)) { return _blake2_blake2s_hexdigest_impl(self); } -/*[clinic end generated code: output=ae8e9b7301d092b4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=62da9834353c0075 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/_iomodule.c.h b/Modules/_io/clinic/_iomodule.c.h index 00ad616b41fe6e..7cc738b6270e94 100644 --- a/Modules/_io/clinic/_iomodule.c.h +++ b/Modules/_io/clinic/_iomodule.c.h @@ -161,7 +161,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw } if (args[1]) { if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("open", 2, "str", args[1]); + _PyArg_BadArgument("open", "2", "str", args[1]); goto exit; } Py_ssize_t mode_length; @@ -207,7 +207,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw } } else { - _PyArg_BadArgument("open", 4, "str or None", args[3]); + _PyArg_BadArgument("open", "4", "str or None", args[3]); goto exit; } if (!--noptargs) { @@ -230,7 +230,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw } } else { - _PyArg_BadArgument("open", 5, "str or None", args[4]); + _PyArg_BadArgument("open", "5", "str or None", args[4]); goto exit; } if (!--noptargs) { @@ -253,7 +253,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw } } else { - _PyArg_BadArgument("open", 6, "str or None", args[5]); + _PyArg_BadArgument("open", "6", "str or None", args[5]); goto exit; } if (!--noptargs) { @@ -311,7 +311,7 @@ _io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("open_code", 1, "str", args[0]); + _PyArg_BadArgument("open_code", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -323,4 +323,4 @@ _io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=d479285078750d68 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4803ae2e28c6093a input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bufferedio.c.h b/Modules/_io/clinic/bufferedio.c.h index d5e8c8a74813c5..4f44f768602f97 100644 --- a/Modules/_io/clinic/bufferedio.c.h +++ b/Modules/_io/clinic/bufferedio.c.h @@ -21,11 +21,11 @@ _io__BufferedIOBase_readinto(PyObject *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", 0, "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", "0", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", 0, "contiguous buffer", arg); + _PyArg_BadArgument("readinto", "0", "contiguous buffer", arg); goto exit; } return_value = _io__BufferedIOBase_readinto_impl(self, &buffer); @@ -58,11 +58,11 @@ _io__BufferedIOBase_readinto1(PyObject *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto1", 0, "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto1", "0", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto1", 0, "contiguous buffer", arg); + _PyArg_BadArgument("readinto1", "0", "contiguous buffer", arg); goto exit; } return_value = _io__BufferedIOBase_readinto1_impl(self, &buffer); @@ -243,11 +243,11 @@ _io__Buffered_readinto(buffered *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", 0, "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", "0", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", 0, "contiguous buffer", arg); + _PyArg_BadArgument("readinto", "0", "contiguous buffer", arg); goto exit; } return_value = _io__Buffered_readinto_impl(self, &buffer); @@ -280,11 +280,11 @@ _io__Buffered_readinto1(buffered *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto1", 0, "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto1", "0", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto1", 0, "contiguous buffer", arg); + _PyArg_BadArgument("readinto1", "0", "contiguous buffer", arg); goto exit; } return_value = _io__Buffered_readinto1_impl(self, &buffer); @@ -538,7 +538,7 @@ _io_BufferedWriter_write(buffered *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("write", 0, "contiguous buffer", arg); + _PyArg_BadArgument("write", "0", "contiguous buffer", arg); goto exit; } return_value = _io_BufferedWriter_write_impl(self, &buffer); @@ -672,4 +672,4 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=b22b4aedd53c340a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1d16a1c2c71cb6b4 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bytesio.c.h b/Modules/_io/clinic/bytesio.c.h index 8dd68f56137f09..980d5390d2bcea 100644 --- a/Modules/_io/clinic/bytesio.c.h +++ b/Modules/_io/clinic/bytesio.c.h @@ -319,11 +319,11 @@ _io_BytesIO_readinto(bytesio *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", 0, "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", "0", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", 0, "contiguous buffer", arg); + _PyArg_BadArgument("readinto", "0", "contiguous buffer", arg); goto exit; } return_value = _io_BytesIO_readinto_impl(self, &buffer); @@ -515,4 +515,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=22e8fb54874b6ee5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0a0a11a282f553d4 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/fileio.c.h b/Modules/_io/clinic/fileio.c.h index 8016e988862464..26616f4f2a935b 100644 --- a/Modules/_io/clinic/fileio.c.h +++ b/Modules/_io/clinic/fileio.c.h @@ -70,7 +70,7 @@ _io_FileIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) } if (fastargs[1]) { if (!PyUnicode_Check(fastargs[1])) { - _PyArg_BadArgument("FileIO", 2, "str", fastargs[1]); + _PyArg_BadArgument("FileIO", "2", "str", fastargs[1]); goto exit; } Py_ssize_t mode_length; @@ -200,11 +200,11 @@ _io_FileIO_readinto(fileio *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", 0, "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", "0", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", 0, "contiguous buffer", arg); + _PyArg_BadArgument("readinto", "0", "contiguous buffer", arg); goto exit; } return_value = _io_FileIO_readinto_impl(self, &buffer); @@ -303,7 +303,7 @@ _io_FileIO_write(fileio *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&b, 'C')) { - _PyArg_BadArgument("write", 0, "contiguous buffer", arg); + _PyArg_BadArgument("write", "0", "contiguous buffer", arg); goto exit; } return_value = _io_FileIO_write_impl(self, &b); @@ -447,4 +447,4 @@ _io_FileIO_isatty(fileio *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO_FILEIO_TRUNCATE_METHODDEF #define _IO_FILEIO_TRUNCATE_METHODDEF #endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */ -/*[clinic end generated code: output=7ee4f3ae584fc6d2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2f8b077f96ea12a2 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/textio.c.h b/Modules/_io/clinic/textio.c.h index cec9defea0250e..f4499de53e4a9a 100644 --- a/Modules/_io/clinic/textio.c.h +++ b/Modules/_io/clinic/textio.c.h @@ -229,7 +229,7 @@ _io_TextIOWrapper___init__(PyObject *self, PyObject *args, PyObject *kwargs) } } else { - _PyArg_BadArgument("TextIOWrapper", 2, "str or None", fastargs[1]); + _PyArg_BadArgument("TextIOWrapper", "2", "str or None", fastargs[1]); goto exit; } if (!--noptargs) { @@ -258,7 +258,7 @@ _io_TextIOWrapper___init__(PyObject *self, PyObject *args, PyObject *kwargs) } } else { - _PyArg_BadArgument("TextIOWrapper", 4, "str or None", fastargs[3]); + _PyArg_BadArgument("TextIOWrapper", "4", "str or None", fastargs[3]); goto exit; } if (!--noptargs) { @@ -401,7 +401,7 @@ _io_TextIOWrapper_write(textio *self, PyObject *arg) PyObject *text; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("write", 0, "str", arg); + _PyArg_BadArgument("write", "0", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -701,4 +701,4 @@ _io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored)) { return _io_TextIOWrapper_close_impl(self); } -/*[clinic end generated code: output=b651e056e3000f88 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a38b219e50d81690 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/winconsoleio.c.h b/Modules/_io/clinic/winconsoleio.c.h index bb0cdc4558dd86..e2b6960ca72f97 100644 --- a/Modules/_io/clinic/winconsoleio.c.h +++ b/Modules/_io/clinic/winconsoleio.c.h @@ -69,7 +69,7 @@ _io__WindowsConsoleIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) } if (fastargs[1]) { if (!PyUnicode_Check(fastargs[1])) { - _PyArg_BadArgument("_WindowsConsoleIO", 2, "str", fastargs[1]); + _PyArg_BadArgument("_WindowsConsoleIO", "2", "str", fastargs[1]); goto exit; } Py_ssize_t mode_length; @@ -200,11 +200,11 @@ _io__WindowsConsoleIO_readinto(winconsoleio *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", 0, "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", "0", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", 0, "contiguous buffer", arg); + _PyArg_BadArgument("readinto", "0", "contiguous buffer", arg); goto exit; } return_value = _io__WindowsConsoleIO_readinto_impl(self, &buffer); @@ -313,7 +313,7 @@ _io__WindowsConsoleIO_write(winconsoleio *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&b, 'C')) { - _PyArg_BadArgument("write", 0, "contiguous buffer", arg); + _PyArg_BadArgument("write", "0", "contiguous buffer", arg); goto exit; } return_value = _io__WindowsConsoleIO_write_impl(self, &b); @@ -386,4 +386,4 @@ _io__WindowsConsoleIO_isatty(winconsoleio *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */ -/*[clinic end generated code: output=57bf2c09a42bd330 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=db52855ebb7ba931 input=a9049054013a1b77]*/ diff --git a/Modules/_multiprocessing/clinic/posixshmem.c.h b/Modules/_multiprocessing/clinic/posixshmem.c.h index 0ebfa2fe3789d1..7a6fb818d9b70a 100644 --- a/Modules/_multiprocessing/clinic/posixshmem.c.h +++ b/Modules/_multiprocessing/clinic/posixshmem.c.h @@ -35,7 +35,7 @@ _posixshmem_shm_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("shm_open", 1, "str", args[0]); + _PyArg_BadArgument("shm_open", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -108,7 +108,7 @@ _posixshmem_shm_unlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("shm_unlink", 1, "str", args[0]); + _PyArg_BadArgument("shm_unlink", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -130,4 +130,4 @@ _posixshmem_shm_unlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs #ifndef _POSIXSHMEM_SHM_UNLINK_METHODDEF #define _POSIXSHMEM_SHM_UNLINK_METHODDEF #endif /* !defined(_POSIXSHMEM_SHM_UNLINK_METHODDEF) */ -/*[clinic end generated code: output=be42e23c18677c0f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=728a3d3486a48da5 input=a9049054013a1b77]*/ diff --git a/Modules/cjkcodecs/clinic/multibytecodec.c.h b/Modules/cjkcodecs/clinic/multibytecodec.c.h index 84774f007600f1..dabc5be119c1b8 100644 --- a/Modules/cjkcodecs/clinic/multibytecodec.c.h +++ b/Modules/cjkcodecs/clinic/multibytecodec.c.h @@ -55,7 +55,7 @@ _multibytecodec_MultibyteCodec_encode(MultibyteCodecObject *self, PyObject *cons } } else { - _PyArg_BadArgument("encode", 2, "str or None", args[1]); + _PyArg_BadArgument("encode", "2", "str or None", args[1]); goto exit; } skip_optional_pos: @@ -103,7 +103,7 @@ _multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject *cons goto exit; } if (!PyBuffer_IsContiguous(&input, 'C')) { - _PyArg_BadArgument("decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("decode", "1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -124,7 +124,7 @@ _multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject *cons } } else { - _PyArg_BadArgument("decode", 2, "str or None", args[1]); + _PyArg_BadArgument("decode", "2", "str or None", args[1]); goto exit; } skip_optional_pos: @@ -223,7 +223,7 @@ _multibytecodec_MultibyteIncrementalEncoder_setstate(MultibyteIncrementalEncoder PyLongObject *statelong; if (!PyLong_Check(arg)) { - _PyArg_BadArgument("setstate", 0, "int", arg); + _PyArg_BadArgument("setstate", "0", "int", arg); goto exit; } statelong = (PyLongObject *)arg; @@ -282,7 +282,7 @@ _multibytecodec_MultibyteIncrementalDecoder_decode(MultibyteIncrementalDecoderOb goto exit; } if (!PyBuffer_IsContiguous(&input, 'C')) { - _PyArg_BadArgument("decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("decode", "1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -345,7 +345,7 @@ _multibytecodec_MultibyteIncrementalDecoder_setstate(MultibyteIncrementalDecoder PyObject *state; if (!PyTuple_Check(arg)) { - _PyArg_BadArgument("setstate", 0, "tuple", arg); + _PyArg_BadArgument("setstate", "0", "tuple", arg); goto exit; } state = arg; @@ -525,4 +525,4 @@ PyDoc_STRVAR(_multibytecodec___create_codec__doc__, #define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \ {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__}, -/*[clinic end generated code: output=eb95a408c4ddbfff input=a9049054013a1b77]*/ +/*[clinic end generated code: output=131713313f23dfd6 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_bz2module.c.h b/Modules/clinic/_bz2module.c.h index cc16d8bb228fe5..3827d43c4e3eef 100644 --- a/Modules/clinic/_bz2module.c.h +++ b/Modules/clinic/_bz2module.c.h @@ -29,7 +29,7 @@ _bz2_BZ2Compressor_compress(BZ2Compressor *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("compress", 0, "contiguous buffer", arg); + _PyArg_BadArgument("compress", "0", "contiguous buffer", arg); goto exit; } return_value = _bz2_BZ2Compressor_compress_impl(self, &data); @@ -156,7 +156,7 @@ _bz2_BZ2Decompressor_decompress(BZ2Decompressor *self, PyObject *const *args, Py goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("decompress", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("decompress", "1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -220,4 +220,4 @@ _bz2_BZ2Decompressor___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=8e123f4eec497655 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2cf12abaf4a7b18e input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_codecsmodule.c.h b/Modules/clinic/_codecsmodule.c.h index 65e24832fff6b3..cdd05347c7f040 100644 --- a/Modules/clinic/_codecsmodule.c.h +++ b/Modules/clinic/_codecsmodule.c.h @@ -34,7 +34,7 @@ _codecs_lookup(PyObject *module, PyObject *arg) const char *encoding; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("lookup", 0, "str", arg); + _PyArg_BadArgument("lookup", "0", "str", arg); goto exit; } Py_ssize_t encoding_length; @@ -93,7 +93,7 @@ _codecs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[1]) { if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("encode", 2, "str", args[1]); + _PyArg_BadArgument("encode", "2", "str", args[1]); goto exit; } Py_ssize_t encoding_length; @@ -110,7 +110,7 @@ _codecs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje } } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("encode", 3, "str", args[2]); + _PyArg_BadArgument("encode", "3", "str", args[2]); goto exit; } Py_ssize_t errors_length; @@ -170,7 +170,7 @@ _codecs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[1]) { if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("decode", 2, "str", args[1]); + _PyArg_BadArgument("decode", "2", "str", args[1]); goto exit; } Py_ssize_t encoding_length; @@ -187,7 +187,7 @@ _codecs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje } } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("decode", 3, "str", args[2]); + _PyArg_BadArgument("decode", "3", "str", args[2]); goto exit; } Py_ssize_t errors_length; @@ -225,7 +225,7 @@ _codecs__forget_codec(PyObject *module, PyObject *arg) const char *encoding; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("_forget_codec", 0, "str", arg); + _PyArg_BadArgument("_forget_codec", "0", "str", arg); goto exit; } Py_ssize_t encoding_length; @@ -278,7 +278,7 @@ _codecs_escape_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("escape_decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("escape_decode", "1", "contiguous buffer", args[0]); goto exit; } } @@ -300,7 +300,7 @@ _codecs_escape_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("escape_decode", 2, "str or None", args[1]); + _PyArg_BadArgument("escape_decode", "2", "str or None", args[1]); goto exit; } skip_optional: @@ -338,7 +338,7 @@ _codecs_escape_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBytes_Check(args[0])) { - _PyArg_BadArgument("escape_encode", 1, "bytes", args[0]); + _PyArg_BadArgument("escape_encode", "1", "bytes", args[0]); goto exit; } data = args[0]; @@ -360,7 +360,7 @@ _codecs_escape_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("escape_encode", 2, "str or None", args[1]); + _PyArg_BadArgument("escape_encode", "2", "str or None", args[1]); goto exit; } skip_optional: @@ -397,7 +397,7 @@ _codecs_utf_7_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_7_decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_7_decode", "1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -418,7 +418,7 @@ _codecs_utf_7_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_7_decode", 2, "str or None", args[1]); + _PyArg_BadArgument("utf_7_decode", "2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -472,7 +472,7 @@ _codecs_utf_8_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_8_decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_8_decode", "1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -493,7 +493,7 @@ _codecs_utf_8_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_8_decode", 2, "str or None", args[1]); + _PyArg_BadArgument("utf_8_decode", "2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -547,7 +547,7 @@ _codecs_utf_16_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_16_decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_16_decode", "1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -568,7 +568,7 @@ _codecs_utf_16_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_16_decode", 2, "str or None", args[1]); + _PyArg_BadArgument("utf_16_decode", "2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -622,7 +622,7 @@ _codecs_utf_16_le_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_16_le_decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_16_le_decode", "1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -643,7 +643,7 @@ _codecs_utf_16_le_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_le_decode", 2, "str or None", args[1]); + _PyArg_BadArgument("utf_16_le_decode", "2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -697,7 +697,7 @@ _codecs_utf_16_be_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_16_be_decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_16_be_decode", "1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -718,7 +718,7 @@ _codecs_utf_16_be_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_be_decode", 2, "str or None", args[1]); + _PyArg_BadArgument("utf_16_be_decode", "2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -774,7 +774,7 @@ _codecs_utf_16_ex_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_16_ex_decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_16_ex_decode", "1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -795,7 +795,7 @@ _codecs_utf_16_ex_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_ex_decode", 2, "str or None", args[1]); + _PyArg_BadArgument("utf_16_ex_decode", "2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -861,7 +861,7 @@ _codecs_utf_32_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_32_decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_32_decode", "1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -882,7 +882,7 @@ _codecs_utf_32_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_32_decode", 2, "str or None", args[1]); + _PyArg_BadArgument("utf_32_decode", "2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -936,7 +936,7 @@ _codecs_utf_32_le_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_32_le_decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_32_le_decode", "1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -957,7 +957,7 @@ _codecs_utf_32_le_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_le_decode", 2, "str or None", args[1]); + _PyArg_BadArgument("utf_32_le_decode", "2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1011,7 +1011,7 @@ _codecs_utf_32_be_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_32_be_decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_32_be_decode", "1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1032,7 +1032,7 @@ _codecs_utf_32_be_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_be_decode", 2, "str or None", args[1]); + _PyArg_BadArgument("utf_32_be_decode", "2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1088,7 +1088,7 @@ _codecs_utf_32_ex_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_32_ex_decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_32_ex_decode", "1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1109,7 +1109,7 @@ _codecs_utf_32_ex_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_ex_decode", 2, "str or None", args[1]); + _PyArg_BadArgument("utf_32_ex_decode", "2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1183,7 +1183,7 @@ _codecs_unicode_escape_decode(PyObject *module, PyObject *const *args, Py_ssize_ goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("unicode_escape_decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("unicode_escape_decode", "1", "contiguous buffer", args[0]); goto exit; } } @@ -1205,7 +1205,7 @@ _codecs_unicode_escape_decode(PyObject *module, PyObject *const *args, Py_ssize_ } } else { - _PyArg_BadArgument("unicode_escape_decode", 2, "str or None", args[1]); + _PyArg_BadArgument("unicode_escape_decode", "2", "str or None", args[1]); goto exit; } skip_optional: @@ -1255,7 +1255,7 @@ _codecs_raw_unicode_escape_decode(PyObject *module, PyObject *const *args, Py_ss goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("raw_unicode_escape_decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("raw_unicode_escape_decode", "1", "contiguous buffer", args[0]); goto exit; } } @@ -1277,7 +1277,7 @@ _codecs_raw_unicode_escape_decode(PyObject *module, PyObject *const *args, Py_ss } } else { - _PyArg_BadArgument("raw_unicode_escape_decode", 2, "str or None", args[1]); + _PyArg_BadArgument("raw_unicode_escape_decode", "2", "str or None", args[1]); goto exit; } skip_optional: @@ -1318,7 +1318,7 @@ _codecs_latin_1_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("latin_1_decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("latin_1_decode", "1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1339,7 +1339,7 @@ _codecs_latin_1_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs } } else { - _PyArg_BadArgument("latin_1_decode", 2, "str or None", args[1]); + _PyArg_BadArgument("latin_1_decode", "2", "str or None", args[1]); goto exit; } skip_optional: @@ -1380,7 +1380,7 @@ _codecs_ascii_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("ascii_decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("ascii_decode", "1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1401,7 +1401,7 @@ _codecs_ascii_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("ascii_decode", 2, "str or None", args[1]); + _PyArg_BadArgument("ascii_decode", "2", "str or None", args[1]); goto exit; } skip_optional: @@ -1443,7 +1443,7 @@ _codecs_charmap_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("charmap_decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("charmap_decode", "1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1464,7 +1464,7 @@ _codecs_charmap_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs } } else { - _PyArg_BadArgument("charmap_decode", 2, "str or None", args[1]); + _PyArg_BadArgument("charmap_decode", "2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1512,7 +1512,7 @@ _codecs_mbcs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("mbcs_decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("mbcs_decode", "1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1533,7 +1533,7 @@ _codecs_mbcs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("mbcs_decode", 2, "str or None", args[1]); + _PyArg_BadArgument("mbcs_decode", "2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1591,7 +1591,7 @@ _codecs_oem_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("oem_decode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("oem_decode", "1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1612,7 +1612,7 @@ _codecs_oem_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("oem_decode", 2, "str or None", args[1]); + _PyArg_BadArgument("oem_decode", "2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1680,7 +1680,7 @@ _codecs_code_page_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("code_page_decode", 2, "contiguous buffer", args[1]); + _PyArg_BadArgument("code_page_decode", "2", "contiguous buffer", args[1]); goto exit; } if (nargs < 3) { @@ -1701,7 +1701,7 @@ _codecs_code_page_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("code_page_decode", 3, "str or None", args[2]); + _PyArg_BadArgument("code_page_decode", "3", "str or None", args[2]); goto exit; } if (nargs < 4) { @@ -1765,7 +1765,7 @@ _codecs_readbuffer_encode(PyObject *module, PyObject *const *args, Py_ssize_t na goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("readbuffer_encode", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("readbuffer_encode", "1", "contiguous buffer", args[0]); goto exit; } } @@ -1787,7 +1787,7 @@ _codecs_readbuffer_encode(PyObject *module, PyObject *const *args, Py_ssize_t na } } else { - _PyArg_BadArgument("readbuffer_encode", 2, "str or None", args[1]); + _PyArg_BadArgument("readbuffer_encode", "2", "str or None", args[1]); goto exit; } skip_optional: @@ -1825,7 +1825,7 @@ _codecs_utf_7_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_7_encode", 1, "str", args[0]); + _PyArg_BadArgument("utf_7_encode", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -1850,7 +1850,7 @@ _codecs_utf_7_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_7_encode", 2, "str or None", args[1]); + _PyArg_BadArgument("utf_7_encode", "2", "str or None", args[1]); goto exit; } skip_optional: @@ -1883,7 +1883,7 @@ _codecs_utf_8_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_8_encode", 1, "str", args[0]); + _PyArg_BadArgument("utf_8_encode", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -1908,7 +1908,7 @@ _codecs_utf_8_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_8_encode", 2, "str or None", args[1]); + _PyArg_BadArgument("utf_8_encode", "2", "str or None", args[1]); goto exit; } skip_optional: @@ -1942,7 +1942,7 @@ _codecs_utf_16_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_16_encode", 1, "str", args[0]); + _PyArg_BadArgument("utf_16_encode", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -1967,7 +1967,7 @@ _codecs_utf_16_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_16_encode", 2, "str or None", args[1]); + _PyArg_BadArgument("utf_16_encode", "2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -2012,7 +2012,7 @@ _codecs_utf_16_le_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_16_le_encode", 1, "str", args[0]); + _PyArg_BadArgument("utf_16_le_encode", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2037,7 +2037,7 @@ _codecs_utf_16_le_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_le_encode", 2, "str or None", args[1]); + _PyArg_BadArgument("utf_16_le_encode", "2", "str or None", args[1]); goto exit; } skip_optional: @@ -2070,7 +2070,7 @@ _codecs_utf_16_be_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_16_be_encode", 1, "str", args[0]); + _PyArg_BadArgument("utf_16_be_encode", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2095,7 +2095,7 @@ _codecs_utf_16_be_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_be_encode", 2, "str or None", args[1]); + _PyArg_BadArgument("utf_16_be_encode", "2", "str or None", args[1]); goto exit; } skip_optional: @@ -2129,7 +2129,7 @@ _codecs_utf_32_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_32_encode", 1, "str", args[0]); + _PyArg_BadArgument("utf_32_encode", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2154,7 +2154,7 @@ _codecs_utf_32_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_32_encode", 2, "str or None", args[1]); + _PyArg_BadArgument("utf_32_encode", "2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -2199,7 +2199,7 @@ _codecs_utf_32_le_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_32_le_encode", 1, "str", args[0]); + _PyArg_BadArgument("utf_32_le_encode", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2224,7 +2224,7 @@ _codecs_utf_32_le_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_le_encode", 2, "str or None", args[1]); + _PyArg_BadArgument("utf_32_le_encode", "2", "str or None", args[1]); goto exit; } skip_optional: @@ -2257,7 +2257,7 @@ _codecs_utf_32_be_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_32_be_encode", 1, "str", args[0]); + _PyArg_BadArgument("utf_32_be_encode", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2282,7 +2282,7 @@ _codecs_utf_32_be_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_be_encode", 2, "str or None", args[1]); + _PyArg_BadArgument("utf_32_be_encode", "2", "str or None", args[1]); goto exit; } skip_optional: @@ -2315,7 +2315,7 @@ _codecs_unicode_escape_encode(PyObject *module, PyObject *const *args, Py_ssize_ goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("unicode_escape_encode", 1, "str", args[0]); + _PyArg_BadArgument("unicode_escape_encode", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2340,7 +2340,7 @@ _codecs_unicode_escape_encode(PyObject *module, PyObject *const *args, Py_ssize_ } } else { - _PyArg_BadArgument("unicode_escape_encode", 2, "str or None", args[1]); + _PyArg_BadArgument("unicode_escape_encode", "2", "str or None", args[1]); goto exit; } skip_optional: @@ -2373,7 +2373,7 @@ _codecs_raw_unicode_escape_encode(PyObject *module, PyObject *const *args, Py_ss goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("raw_unicode_escape_encode", 1, "str", args[0]); + _PyArg_BadArgument("raw_unicode_escape_encode", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2398,7 +2398,7 @@ _codecs_raw_unicode_escape_encode(PyObject *module, PyObject *const *args, Py_ss } } else { - _PyArg_BadArgument("raw_unicode_escape_encode", 2, "str or None", args[1]); + _PyArg_BadArgument("raw_unicode_escape_encode", "2", "str or None", args[1]); goto exit; } skip_optional: @@ -2431,7 +2431,7 @@ _codecs_latin_1_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("latin_1_encode", 1, "str", args[0]); + _PyArg_BadArgument("latin_1_encode", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2456,7 +2456,7 @@ _codecs_latin_1_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs } } else { - _PyArg_BadArgument("latin_1_encode", 2, "str or None", args[1]); + _PyArg_BadArgument("latin_1_encode", "2", "str or None", args[1]); goto exit; } skip_optional: @@ -2489,7 +2489,7 @@ _codecs_ascii_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("ascii_encode", 1, "str", args[0]); + _PyArg_BadArgument("ascii_encode", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2514,7 +2514,7 @@ _codecs_ascii_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("ascii_encode", 2, "str or None", args[1]); + _PyArg_BadArgument("ascii_encode", "2", "str or None", args[1]); goto exit; } skip_optional: @@ -2548,7 +2548,7 @@ _codecs_charmap_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("charmap_encode", 1, "str", args[0]); + _PyArg_BadArgument("charmap_encode", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2573,7 +2573,7 @@ _codecs_charmap_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs } } else { - _PyArg_BadArgument("charmap_encode", 2, "str or None", args[1]); + _PyArg_BadArgument("charmap_encode", "2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -2605,7 +2605,7 @@ _codecs_charmap_build(PyObject *module, PyObject *arg) PyObject *map; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("charmap_build", 0, "str", arg); + _PyArg_BadArgument("charmap_build", "0", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -2642,7 +2642,7 @@ _codecs_mbcs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("mbcs_encode", 1, "str", args[0]); + _PyArg_BadArgument("mbcs_encode", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2667,7 +2667,7 @@ _codecs_mbcs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("mbcs_encode", 2, "str or None", args[1]); + _PyArg_BadArgument("mbcs_encode", "2", "str or None", args[1]); goto exit; } skip_optional: @@ -2703,7 +2703,7 @@ _codecs_oem_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("oem_encode", 1, "str", args[0]); + _PyArg_BadArgument("oem_encode", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2728,7 +2728,7 @@ _codecs_oem_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("oem_encode", 2, "str or None", args[1]); + _PyArg_BadArgument("oem_encode", "2", "str or None", args[1]); goto exit; } skip_optional: @@ -2775,7 +2775,7 @@ _codecs_code_page_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("code_page_encode", 2, "str", args[1]); + _PyArg_BadArgument("code_page_encode", "2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -2800,7 +2800,7 @@ _codecs_code_page_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("code_page_encode", 3, "str or None", args[2]); + _PyArg_BadArgument("code_page_encode", "3", "str or None", args[2]); goto exit; } skip_optional: @@ -2840,7 +2840,7 @@ _codecs_register_error(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("register_error", 1, "str", args[0]); + _PyArg_BadArgument("register_error", "1", "str", args[0]); goto exit; } Py_ssize_t errors_length; @@ -2881,7 +2881,7 @@ _codecs_lookup_error(PyObject *module, PyObject *arg) const char *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("lookup_error", 0, "str", arg); + _PyArg_BadArgument("lookup_error", "0", "str", arg); goto exit; } Py_ssize_t name_length; @@ -2922,4 +2922,4 @@ _codecs_lookup_error(PyObject *module, PyObject *arg) #ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF #define _CODECS_CODE_PAGE_ENCODE_METHODDEF #endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */ -/*[clinic end generated code: output=da3c47709a55a05e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e6c9bd2475b9a79f input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_cryptmodule.c.h b/Modules/clinic/_cryptmodule.c.h index 2fcb0c1bf12c3a..fef3d3881c8dbc 100644 --- a/Modules/clinic/_cryptmodule.c.h +++ b/Modules/clinic/_cryptmodule.c.h @@ -30,7 +30,7 @@ crypt_crypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("crypt", 1, "str", args[0]); + _PyArg_BadArgument("crypt", "1", "str", args[0]); goto exit; } Py_ssize_t word_length; @@ -43,7 +43,7 @@ crypt_crypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("crypt", 2, "str", args[1]); + _PyArg_BadArgument("crypt", "2", "str", args[1]); goto exit; } Py_ssize_t salt_length; @@ -60,4 +60,4 @@ crypt_crypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=3f75d4d4be4dddbb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=634a3af1b403be9c input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_curses_panel.c.h b/Modules/clinic/_curses_panel.c.h index 0df442056ea9f3..5392086f0e0880 100644 --- a/Modules/clinic/_curses_panel.c.h +++ b/Modules/clinic/_curses_panel.c.h @@ -214,7 +214,7 @@ _curses_panel_panel_replace(PyCursesPanelObject *self, PyObject *arg) PyCursesWindowObject *win; if (!PyObject_TypeCheck(arg, &PyCursesWindow_Type)) { - _PyArg_BadArgument("replace", 0, (&PyCursesWindow_Type)->tp_name, arg); + _PyArg_BadArgument("replace", "0", (&PyCursesWindow_Type)->tp_name, arg); goto exit; } win = (PyCursesWindowObject *)arg; @@ -288,7 +288,7 @@ _curses_panel_new_panel(PyObject *module, PyObject *arg) PyCursesWindowObject *win; if (!PyObject_TypeCheck(arg, &PyCursesWindow_Type)) { - _PyArg_BadArgument("new_panel", 0, (&PyCursesWindow_Type)->tp_name, arg); + _PyArg_BadArgument("new_panel", "0", (&PyCursesWindow_Type)->tp_name, arg); goto exit; } win = (PyCursesWindowObject *)arg; @@ -335,4 +335,4 @@ _curses_panel_update_panels(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _curses_panel_update_panels_impl(module); } -/*[clinic end generated code: output=3cc16062281b7e07 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=056e7047370925fd input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_cursesmodule.c.h b/Modules/clinic/_cursesmodule.c.h index 6837eac3909695..f24e4fdb09e489 100644 --- a/Modules/clinic/_cursesmodule.c.h +++ b/Modules/clinic/_cursesmodule.c.h @@ -2521,7 +2521,7 @@ _curses_ungetmouse(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyLong_Check(args[4])) { - _PyArg_BadArgument("ungetmouse", 5, "int", args[4]); + _PyArg_BadArgument("ungetmouse", "5", "int", args[4]); goto exit; } bstate = PyLong_AsUnsignedLongMask(args[4]); @@ -3017,7 +3017,7 @@ _curses_setupterm(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO } } else { - _PyArg_BadArgument("setupterm", 1, "str or None", args[0]); + _PyArg_BadArgument("setupterm", "1", "str or None", args[0]); goto exit; } if (!--noptargs) { @@ -3326,7 +3326,7 @@ _curses_mousemask(PyObject *module, PyObject *arg) unsigned long newmask; if (!PyLong_Check(arg)) { - _PyArg_BadArgument("mousemask", 0, "int", arg); + _PyArg_BadArgument("mousemask", "0", "int", arg); goto exit; } newmask = PyLong_AsUnsignedLongMask(arg); @@ -4201,7 +4201,7 @@ _curses_tigetflag(PyObject *module, PyObject *arg) const char *capname; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("tigetflag", 0, "str", arg); + _PyArg_BadArgument("tigetflag", "0", "str", arg); goto exit; } Py_ssize_t capname_length; @@ -4244,7 +4244,7 @@ _curses_tigetnum(PyObject *module, PyObject *arg) const char *capname; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("tigetnum", 0, "str", arg); + _PyArg_BadArgument("tigetnum", "0", "str", arg); goto exit; } Py_ssize_t capname_length; @@ -4287,7 +4287,7 @@ _curses_tigetstr(PyObject *module, PyObject *arg) const char *capname; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("tigetstr", 0, "str", arg); + _PyArg_BadArgument("tigetstr", "0", "str", arg); goto exit; } Py_ssize_t capname_length; @@ -4569,4 +4569,4 @@ _curses_use_default_colors(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef _CURSES_USE_DEFAULT_COLORS_METHODDEF #define _CURSES_USE_DEFAULT_COLORS_METHODDEF #endif /* !defined(_CURSES_USE_DEFAULT_COLORS_METHODDEF) */ -/*[clinic end generated code: output=1350eeb0c1e06af6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6be3c7512f474c3b input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_dbmmodule.c.h b/Modules/clinic/_dbmmodule.c.h index e54c69cf708294..b502919fc2e316 100644 --- a/Modules/clinic/_dbmmodule.c.h +++ b/Modules/clinic/_dbmmodule.c.h @@ -136,7 +136,7 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("open", 1, "str", args[0]); + _PyArg_BadArgument("open", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -147,7 +147,7 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("open", 2, "str", args[1]); + _PyArg_BadArgument("open", "2", "str", args[1]); goto exit; } Py_ssize_t flags_length; @@ -177,4 +177,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=7f5d30ef5d820b8a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4fdf444215483628 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_elementtree.c.h b/Modules/clinic/_elementtree.c.h index 0f55480140b315..62d003763d4981 100644 --- a/Modules/clinic/_elementtree.c.h +++ b/Modules/clinic/_elementtree.c.h @@ -20,7 +20,7 @@ _elementtree_Element_append(ElementObject *self, PyObject *arg) PyObject *subelement; if (!PyObject_TypeCheck(arg, &Element_Type)) { - _PyArg_BadArgument("append", 0, (&Element_Type)->tp_name, arg); + _PyArg_BadArgument("append", "0", (&Element_Type)->tp_name, arg); goto exit; } subelement = arg; @@ -82,7 +82,7 @@ _elementtree_Element___deepcopy__(ElementObject *self, PyObject *arg) PyObject *memo; if (!PyDict_Check(arg)) { - _PyArg_BadArgument("__deepcopy__", 0, "dict", arg); + _PyArg_BadArgument("__deepcopy__", "0", "dict", arg); goto exit; } memo = arg; @@ -501,7 +501,7 @@ _elementtree_Element_insert(ElementObject *self, PyObject *const *args, Py_ssize index = ival; } if (!PyObject_TypeCheck(args[1], &Element_Type)) { - _PyArg_BadArgument("insert", 2, (&Element_Type)->tp_name, args[1]); + _PyArg_BadArgument("insert", "2", (&Element_Type)->tp_name, args[1]); goto exit; } subelement = args[1]; @@ -593,7 +593,7 @@ _elementtree_Element_remove(ElementObject *self, PyObject *arg) PyObject *subelement; if (!PyObject_TypeCheck(arg, &Element_Type)) { - _PyArg_BadArgument("remove", 0, (&Element_Type)->tp_name, arg); + _PyArg_BadArgument("remove", "0", (&Element_Type)->tp_name, arg); goto exit; } subelement = arg; @@ -892,7 +892,7 @@ _elementtree_XMLParser___init__(PyObject *self, PyObject *args, PyObject *kwargs } } else { - _PyArg_BadArgument("XMLParser", 2, "str or None", fastargs[1]); + _PyArg_BadArgument("XMLParser", "'encoding'", "str or None", fastargs[1]); goto exit; } skip_optional_kwonly: @@ -969,4 +969,4 @@ _elementtree_XMLParser__setevents(XMLParserObject *self, PyObject *const *args, exit: return return_value; } -/*[clinic end generated code: output=386a68425d072b5c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8816432a896a50f8 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_gdbmmodule.c.h b/Modules/clinic/_gdbmmodule.c.h index 15f47dc70dc65a..ac6a7b046deeb1 100644 --- a/Modules/clinic/_gdbmmodule.c.h +++ b/Modules/clinic/_gdbmmodule.c.h @@ -257,7 +257,7 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("open", 1, "str", args[0]); + _PyArg_BadArgument("open", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -268,7 +268,7 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("open", 2, "str", args[1]); + _PyArg_BadArgument("open", "2", "str", args[1]); goto exit; } Py_ssize_t flags_length; @@ -298,4 +298,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=0a72598e5a3acd60 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=199ac3c55b5f8718 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_hashopenssl.c.h b/Modules/clinic/_hashopenssl.c.h index 5596f13e508f7d..5445b9efb94c9c 100644 --- a/Modules/clinic/_hashopenssl.c.h +++ b/Modules/clinic/_hashopenssl.c.h @@ -145,7 +145,7 @@ pbkdf2_hmac(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("pbkdf2_hmac", 1, "str", args[0]); + _PyArg_BadArgument("pbkdf2_hmac", "1", "str", args[0]); goto exit; } Py_ssize_t hash_name_length; @@ -161,14 +161,14 @@ pbkdf2_hmac(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyBuffer_IsContiguous(&password, 'C')) { - _PyArg_BadArgument("pbkdf2_hmac", 2, "contiguous buffer", args[1]); + _PyArg_BadArgument("pbkdf2_hmac", "2", "contiguous buffer", args[1]); goto exit; } if (PyObject_GetBuffer(args[2], &salt, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&salt, 'C')) { - _PyArg_BadArgument("pbkdf2_hmac", 3, "contiguous buffer", args[2]); + _PyArg_BadArgument("pbkdf2_hmac", "3", "contiguous buffer", args[2]); goto exit; } if (PyFloat_Check(args[3])) { @@ -243,7 +243,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&password, 'C')) { - _PyArg_BadArgument("scrypt", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("scrypt", "1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -254,7 +254,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&salt, 'C')) { - _PyArg_BadArgument("scrypt", 2, "contiguous buffer", args[1]); + _PyArg_BadArgument("scrypt", "'salt'", "contiguous buffer", args[1]); goto exit; } if (!--noptargs) { @@ -263,7 +263,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj } if (args[2]) { if (!PyLong_Check(args[2])) { - _PyArg_BadArgument("scrypt", 3, "int", args[2]); + _PyArg_BadArgument("scrypt", "'n'", "int", args[2]); goto exit; } n_obj = args[2]; @@ -273,7 +273,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj } if (args[3]) { if (!PyLong_Check(args[3])) { - _PyArg_BadArgument("scrypt", 4, "int", args[3]); + _PyArg_BadArgument("scrypt", "'r'", "int", args[3]); goto exit; } r_obj = args[3]; @@ -283,7 +283,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj } if (args[4]) { if (!PyLong_Check(args[4])) { - _PyArg_BadArgument("scrypt", 5, "int", args[4]); + _PyArg_BadArgument("scrypt", "'p'", "int", args[4]); goto exit; } p_obj = args[4]; @@ -364,18 +364,18 @@ _hashlib_hmac_digest(PyObject *module, PyObject *const *args, Py_ssize_t nargs, goto exit; } if (!PyBuffer_IsContiguous(&key, 'C')) { - _PyArg_BadArgument("hmac_digest", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("hmac_digest", "1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &msg, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&msg, 'C')) { - _PyArg_BadArgument("hmac_digest", 2, "contiguous buffer", args[1]); + _PyArg_BadArgument("hmac_digest", "2", "contiguous buffer", args[1]); goto exit; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("hmac_digest", 3, "str", args[2]); + _PyArg_BadArgument("hmac_digest", "3", "str", args[2]); goto exit; } Py_ssize_t digest_length; @@ -409,4 +409,4 @@ _hashlib_hmac_digest(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #ifndef _HASHLIB_SCRYPT_METHODDEF #define _HASHLIB_SCRYPT_METHODDEF #endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */ -/*[clinic end generated code: output=5955ec791260045a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0625639de9103841 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_lzmamodule.c.h b/Modules/clinic/_lzmamodule.c.h index 68aa770d41f8a9..3c305dccbf1ca6 100644 --- a/Modules/clinic/_lzmamodule.c.h +++ b/Modules/clinic/_lzmamodule.c.h @@ -29,7 +29,7 @@ _lzma_LZMACompressor_compress(Compressor *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("compress", 0, "contiguous buffer", arg); + _PyArg_BadArgument("compress", "0", "contiguous buffer", arg); goto exit; } return_value = _lzma_LZMACompressor_compress_impl(self, &data); @@ -110,7 +110,7 @@ _lzma_LZMADecompressor_decompress(Decompressor *self, PyObject *const *args, Py_ goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("decompress", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("decompress", "1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -321,7 +321,7 @@ _lzma__decode_filter_properties(PyObject *module, PyObject *const *args, Py_ssiz goto exit; } if (!PyBuffer_IsContiguous(&encoded_props, 'C')) { - _PyArg_BadArgument("_decode_filter_properties", 2, "contiguous buffer", args[1]); + _PyArg_BadArgument("_decode_filter_properties", "2", "contiguous buffer", args[1]); goto exit; } return_value = _lzma__decode_filter_properties_impl(module, filter_id, &encoded_props); @@ -334,4 +334,4 @@ _lzma__decode_filter_properties(PyObject *module, PyObject *const *args, Py_ssiz return return_value; } -/*[clinic end generated code: output=1a290aa478603107 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1ff47f46a3e7c6ea input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_pickle.c.h b/Modules/clinic/_pickle.c.h index 8ac723fd43a681..e30cd1471aae33 100644 --- a/Modules/clinic/_pickle.c.h +++ b/Modules/clinic/_pickle.c.h @@ -356,7 +356,7 @@ _pickle_Unpickler___init__(PyObject *self, PyObject *args, PyObject *kwargs) } if (fastargs[2]) { if (!PyUnicode_Check(fastargs[2])) { - _PyArg_BadArgument("Unpickler", 3, "str", fastargs[2]); + _PyArg_BadArgument("Unpickler", "'encoding'", "str", fastargs[2]); goto exit; } Py_ssize_t encoding_length; @@ -374,7 +374,7 @@ _pickle_Unpickler___init__(PyObject *self, PyObject *args, PyObject *kwargs) } if (fastargs[3]) { if (!PyUnicode_Check(fastargs[3])) { - _PyArg_BadArgument("Unpickler", 4, "str", fastargs[3]); + _PyArg_BadArgument("Unpickler", "'errors'", "str", fastargs[3]); goto exit; } Py_ssize_t errors_length; @@ -691,7 +691,7 @@ _pickle_load(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject } if (args[2]) { if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("load", 3, "str", args[2]); + _PyArg_BadArgument("load", "'encoding'", "str", args[2]); goto exit; } Py_ssize_t encoding_length; @@ -709,7 +709,7 @@ _pickle_load(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject } if (args[3]) { if (!PyUnicode_Check(args[3])) { - _PyArg_BadArgument("load", 4, "str", args[3]); + _PyArg_BadArgument("load", "'errors'", "str", args[3]); goto exit; } Py_ssize_t errors_length; @@ -794,7 +794,7 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec } if (args[2]) { if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("loads", 3, "str", args[2]); + _PyArg_BadArgument("loads", "'encoding'", "str", args[2]); goto exit; } Py_ssize_t encoding_length; @@ -812,7 +812,7 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec } if (args[3]) { if (!PyUnicode_Check(args[3])) { - _PyArg_BadArgument("loads", 4, "str", args[3]); + _PyArg_BadArgument("loads", "'errors'", "str", args[3]); goto exit; } Py_ssize_t errors_length; @@ -835,4 +835,4 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=8dc0e862f96c4afe input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7eebae00cf0a4457 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_sre.c.h b/Modules/clinic/_sre.c.h index 9c08dec4541a47..be2469b937be91 100644 --- a/Modules/clinic/_sre.c.h +++ b/Modules/clinic/_sre.c.h @@ -894,7 +894,7 @@ _sre_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyList_Check(args[2])) { - _PyArg_BadArgument("compile", 3, "list", args[2]); + _PyArg_BadArgument("compile", "3", "list", args[2]); goto exit; } code = args[2]; @@ -916,12 +916,12 @@ _sre_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject groups = ival; } if (!PyDict_Check(args[4])) { - _PyArg_BadArgument("compile", 5, "dict", args[4]); + _PyArg_BadArgument("compile", "5", "dict", args[4]); goto exit; } groupindex = args[4]; if (!PyTuple_Check(args[5])) { - _PyArg_BadArgument("compile", 6, "tuple", args[5]); + _PyArg_BadArgument("compile", "6", "tuple", args[5]); goto exit; } indexgroup = args[5]; @@ -1207,4 +1207,4 @@ _sre_SRE_Scanner_search(ScannerObject *self, PyObject *Py_UNUSED(ignored)) { return _sre_SRE_Scanner_search_impl(self); } -/*[clinic end generated code: output=67b702da5bdc9cac input=a9049054013a1b77]*/ +/*[clinic end generated code: output=25395ef086008eb8 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_ssl.c.h b/Modules/clinic/_ssl.c.h index b1012f7aee2ea7..641afd73384237 100644 --- a/Modules/clinic/_ssl.c.h +++ b/Modules/clinic/_ssl.c.h @@ -222,7 +222,7 @@ _ssl__SSLSocket_write(PySSLSocket *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&b, 'C')) { - _PyArg_BadArgument("write", 0, "contiguous buffer", arg); + _PyArg_BadArgument("write", "0", "contiguous buffer", arg); goto exit; } return_value = _ssl__SSLSocket_write_impl(self, &b); @@ -353,7 +353,7 @@ _ssl__SSLSocket_get_channel_binding(PySSLSocket *self, PyObject *const *args, Py goto skip_optional_pos; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("get_channel_binding", 1, "str", args[0]); + _PyArg_BadArgument("get_channel_binding", "1", "str", args[0]); goto exit; } Py_ssize_t cb_type_length; @@ -439,7 +439,7 @@ _ssl__SSLContext_set_ciphers(PySSLContext *self, PyObject *arg) const char *cipherlist; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("set_ciphers", 0, "str", arg); + _PyArg_BadArgument("set_ciphers", "0", "str", arg); goto exit; } Py_ssize_t cipherlist_length; @@ -500,7 +500,7 @@ _ssl__SSLContext__set_npn_protocols(PySSLContext *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&protos, 'C')) { - _PyArg_BadArgument("_set_npn_protocols", 0, "contiguous buffer", arg); + _PyArg_BadArgument("_set_npn_protocols", "0", "contiguous buffer", arg); goto exit; } return_value = _ssl__SSLContext__set_npn_protocols_impl(self, &protos); @@ -536,7 +536,7 @@ _ssl__SSLContext__set_alpn_protocols(PySSLContext *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&protos, 'C')) { - _PyArg_BadArgument("_set_alpn_protocols", 0, "contiguous buffer", arg); + _PyArg_BadArgument("_set_alpn_protocols", "0", "contiguous buffer", arg); goto exit; } return_value = _ssl__SSLContext__set_alpn_protocols_impl(self, &protos); @@ -690,7 +690,7 @@ _ssl__SSLContext__wrap_socket(PySSLContext *self, PyObject *const *args, Py_ssiz goto exit; } if (!PyObject_TypeCheck(args[0], PySocketModule.Sock_Type)) { - _PyArg_BadArgument("_wrap_socket", 1, (PySocketModule.Sock_Type)->tp_name, args[0]); + _PyArg_BadArgument("_wrap_socket", "1", (PySocketModule.Sock_Type)->tp_name, args[0]); goto exit; } sock = args[0]; @@ -765,12 +765,12 @@ _ssl__SSLContext__wrap_bio(PySSLContext *self, PyObject *const *args, Py_ssize_t goto exit; } if (!PyObject_TypeCheck(args[0], &PySSLMemoryBIO_Type)) { - _PyArg_BadArgument("_wrap_bio", 1, (&PySSLMemoryBIO_Type)->tp_name, args[0]); + _PyArg_BadArgument("_wrap_bio", "1", (&PySSLMemoryBIO_Type)->tp_name, args[0]); goto exit; } incoming = (PySSLMemoryBIO *)args[0]; if (!PyObject_TypeCheck(args[1], &PySSLMemoryBIO_Type)) { - _PyArg_BadArgument("_wrap_bio", 2, (&PySSLMemoryBIO_Type)->tp_name, args[1]); + _PyArg_BadArgument("_wrap_bio", "2", (&PySSLMemoryBIO_Type)->tp_name, args[1]); goto exit; } outgoing = (PySSLMemoryBIO *)args[1]; @@ -1017,7 +1017,7 @@ _ssl_MemoryBIO_write(PySSLMemoryBIO *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&b, 'C')) { - _PyArg_BadArgument("write", 0, "contiguous buffer", arg); + _PyArg_BadArgument("write", "0", "contiguous buffer", arg); goto exit; } return_value = _ssl_MemoryBIO_write_impl(self, &b); @@ -1089,7 +1089,7 @@ _ssl_RAND_add(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&view, 'C')) { - _PyArg_BadArgument("RAND_add", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("RAND_add", "1", "contiguous buffer", args[0]); goto exit; } } @@ -1283,7 +1283,7 @@ _ssl_txt2obj(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("txt2obj", 1, "str", args[0]); + _PyArg_BadArgument("txt2obj", "1", "str", args[0]); goto exit; } Py_ssize_t txt_length; @@ -1376,7 +1376,7 @@ _ssl_enum_certificates(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("enum_certificates", 1, "str", args[0]); + _PyArg_BadArgument("enum_certificates", "1", "str", args[0]); goto exit; } Py_ssize_t store_name_length; @@ -1429,7 +1429,7 @@ _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("enum_crls", 1, "str", args[0]); + _PyArg_BadArgument("enum_crls", "1", "str", args[0]); goto exit; } Py_ssize_t store_name_length; @@ -1476,4 +1476,4 @@ _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #ifndef _SSL_ENUM_CRLS_METHODDEF #define _SSL_ENUM_CRLS_METHODDEF #endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */ -/*[clinic end generated code: output=a399d0eb393b6fab input=a9049054013a1b77]*/ +/*[clinic end generated code: output=84486c0b3f6fed92 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_struct.c.h b/Modules/clinic/_struct.c.h index 908c44266c4ec6..1dc1c0605d2b03 100644 --- a/Modules/clinic/_struct.c.h +++ b/Modules/clinic/_struct.c.h @@ -65,7 +65,7 @@ Struct_unpack(PyStructObject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack", 0, "contiguous buffer", arg); + _PyArg_BadArgument("unpack", "0", "contiguous buffer", arg); goto exit; } return_value = Struct_unpack_impl(self, &buffer); @@ -118,7 +118,7 @@ Struct_unpack_from(PyStructObject *self, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack_from", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("unpack_from", "1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -253,7 +253,7 @@ unpack(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack", 2, "contiguous buffer", args[1]); + _PyArg_BadArgument("unpack", "2", "contiguous buffer", args[1]); goto exit; } return_value = unpack_impl(module, s_object, &buffer); @@ -309,7 +309,7 @@ unpack_from(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack_from", 2, "contiguous buffer", args[1]); + _PyArg_BadArgument("unpack_from", "2", "contiguous buffer", args[1]); goto exit; } if (!noptargs) { @@ -386,4 +386,4 @@ iter_unpack(PyObject *module, PyObject *const *args, Py_ssize_t nargs) return return_value; } -/*[clinic end generated code: output=b642e1002d25ebdd input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3bc4b57a65898202 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_tkinter.c.h b/Modules/clinic/_tkinter.c.h index 0a3e7ff5fc9686..5f149ccc66ec4d 100644 --- a/Modules/clinic/_tkinter.c.h +++ b/Modules/clinic/_tkinter.c.h @@ -20,7 +20,7 @@ _tkinter_tkapp_eval(TkappObject *self, PyObject *arg) const char *script; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("eval", 0, "str", arg); + _PyArg_BadArgument("eval", "0", "str", arg); goto exit; } Py_ssize_t script_length; @@ -56,7 +56,7 @@ _tkinter_tkapp_evalfile(TkappObject *self, PyObject *arg) const char *fileName; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("evalfile", 0, "str", arg); + _PyArg_BadArgument("evalfile", "0", "str", arg); goto exit; } Py_ssize_t fileName_length; @@ -92,7 +92,7 @@ _tkinter_tkapp_record(TkappObject *self, PyObject *arg) const char *script; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("record", 0, "str", arg); + _PyArg_BadArgument("record", "0", "str", arg); goto exit; } Py_ssize_t script_length; @@ -128,7 +128,7 @@ _tkinter_tkapp_adderrorinfo(TkappObject *self, PyObject *arg) const char *msg; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("adderrorinfo", 0, "str", arg); + _PyArg_BadArgument("adderrorinfo", "0", "str", arg); goto exit; } Py_ssize_t msg_length; @@ -188,7 +188,7 @@ _tkinter_tkapp_exprstring(TkappObject *self, PyObject *arg) const char *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("exprstring", 0, "str", arg); + _PyArg_BadArgument("exprstring", "0", "str", arg); goto exit; } Py_ssize_t s_length; @@ -224,7 +224,7 @@ _tkinter_tkapp_exprlong(TkappObject *self, PyObject *arg) const char *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("exprlong", 0, "str", arg); + _PyArg_BadArgument("exprlong", "0", "str", arg); goto exit; } Py_ssize_t s_length; @@ -260,7 +260,7 @@ _tkinter_tkapp_exprdouble(TkappObject *self, PyObject *arg) const char *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("exprdouble", 0, "str", arg); + _PyArg_BadArgument("exprdouble", "0", "str", arg); goto exit; } Py_ssize_t s_length; @@ -296,7 +296,7 @@ _tkinter_tkapp_exprboolean(TkappObject *self, PyObject *arg) const char *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("exprboolean", 0, "str", arg); + _PyArg_BadArgument("exprboolean", "0", "str", arg); goto exit; } Py_ssize_t s_length; @@ -353,7 +353,7 @@ _tkinter_tkapp_createcommand(TkappObject *self, PyObject *const *args, Py_ssize_ goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("createcommand", 1, "str", args[0]); + _PyArg_BadArgument("createcommand", "1", "str", args[0]); goto exit; } Py_ssize_t name_length; @@ -390,7 +390,7 @@ _tkinter_tkapp_deletecommand(TkappObject *self, PyObject *arg) const char *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("deletecommand", 0, "str", arg); + _PyArg_BadArgument("deletecommand", "0", "str", arg); goto exit; } Py_ssize_t name_length; @@ -731,14 +731,14 @@ _tkinter_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("create", 1, "str or None", args[0]); + _PyArg_BadArgument("create", "1", "str or None", args[0]); goto exit; } if (nargs < 2) { goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("create", 2, "str", args[1]); + _PyArg_BadArgument("create", "2", "str", args[1]); goto exit; } Py_ssize_t baseName_length; @@ -754,7 +754,7 @@ _tkinter_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("create", 3, "str", args[2]); + _PyArg_BadArgument("create", "3", "str", args[2]); goto exit; } Py_ssize_t className_length; @@ -832,7 +832,7 @@ _tkinter_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("create", 8, "str or None", args[7]); + _PyArg_BadArgument("create", "8", "str or None", args[7]); goto exit; } skip_optional: @@ -912,4 +912,4 @@ _tkinter_getbusywaitinterval(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */ -/*[clinic end generated code: output=2cf95f0101f3dbca input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1cff0b064379741c input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_weakref.c.h b/Modules/clinic/_weakref.c.h index aa0d77f7180e5e..6c801d8928d970 100644 --- a/Modules/clinic/_weakref.c.h +++ b/Modules/clinic/_weakref.c.h @@ -54,7 +54,7 @@ _weakref__remove_dead_weakref(PyObject *module, PyObject *const *args, Py_ssize_ goto exit; } if (!PyDict_Check(args[0])) { - _PyArg_BadArgument("_remove_dead_weakref", 1, "dict", args[0]); + _PyArg_BadArgument("_remove_dead_weakref", "1", "dict", args[0]); goto exit; } dct = args[0]; @@ -64,4 +64,4 @@ _weakref__remove_dead_weakref(PyObject *module, PyObject *const *args, Py_ssize_ exit: return return_value; } -/*[clinic end generated code: output=eae22e2d2e43120e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e8198041e5e17520 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/arraymodule.c.h b/Modules/clinic/arraymodule.c.h index 5f45b7cf673473..45dc2eeb59e64b 100644 --- a/Modules/clinic/arraymodule.c.h +++ b/Modules/clinic/arraymodule.c.h @@ -345,7 +345,7 @@ array_array_fromstring(arrayobject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("fromstring", 0, "contiguous buffer", arg); + _PyArg_BadArgument("fromstring", "0", "contiguous buffer", arg); goto exit; } } @@ -382,7 +382,7 @@ array_array_frombytes(arrayobject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("frombytes", 0, "contiguous buffer", arg); + _PyArg_BadArgument("frombytes", "0", "contiguous buffer", arg); goto exit; } return_value = array_array_frombytes_impl(self, &buffer); @@ -537,14 +537,14 @@ array__array_reconstructor(PyObject *module, PyObject *const *args, Py_ssize_t n } arraytype = (PyTypeObject *)args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("_array_reconstructor", 2, "a unicode character", args[1]); + _PyArg_BadArgument("_array_reconstructor", "2", "a unicode character", args[1]); goto exit; } if (PyUnicode_READY(args[1])) { goto exit; } if (PyUnicode_GET_LENGTH(args[1]) != 1) { - _PyArg_BadArgument("_array_reconstructor", 2, "a unicode character", args[1]); + _PyArg_BadArgument("_array_reconstructor", "2", "a unicode character", args[1]); goto exit; } typecode = PyUnicode_READ_CHAR(args[1], 0); @@ -599,4 +599,4 @@ PyDoc_STRVAR(array_arrayiterator___setstate____doc__, #define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \ {"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__}, -/*[clinic end generated code: output=c9a40f11f1a866fb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c4ad31a0e13f4b42 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/audioop.c.h b/Modules/clinic/audioop.c.h index 4ea7155373be62..cc3bc424cd73d0 100644 --- a/Modules/clinic/audioop.c.h +++ b/Modules/clinic/audioop.c.h @@ -30,7 +30,7 @@ audioop_getsample(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("getsample", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("getsample", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -96,7 +96,7 @@ audioop_max(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("max", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("max", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -145,7 +145,7 @@ audioop_minmax(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("minmax", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("minmax", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -194,7 +194,7 @@ audioop_avg(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("avg", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("avg", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -243,7 +243,7 @@ audioop_rms(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("rms", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("rms", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -293,14 +293,14 @@ audioop_findfit(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("findfit", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("findfit", "1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &reference, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&reference, 'C')) { - _PyArg_BadArgument("findfit", 2, "contiguous buffer", args[1]); + _PyArg_BadArgument("findfit", "2", "contiguous buffer", args[1]); goto exit; } return_value = audioop_findfit_impl(module, &fragment, &reference); @@ -345,14 +345,14 @@ audioop_findfactor(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("findfactor", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("findfactor", "1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &reference, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&reference, 'C')) { - _PyArg_BadArgument("findfactor", 2, "contiguous buffer", args[1]); + _PyArg_BadArgument("findfactor", "2", "contiguous buffer", args[1]); goto exit; } return_value = audioop_findfactor_impl(module, &fragment, &reference); @@ -397,7 +397,7 @@ audioop_findmax(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("findmax", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("findmax", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -454,7 +454,7 @@ audioop_avgpp(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("avgpp", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("avgpp", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -503,7 +503,7 @@ audioop_maxpp(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("maxpp", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("maxpp", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -552,7 +552,7 @@ audioop_cross(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("cross", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("cross", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -603,7 +603,7 @@ audioop_mul(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("mul", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("mul", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -659,7 +659,7 @@ audioop_tomono(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("tomono", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("tomono", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -719,7 +719,7 @@ audioop_tostereo(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("tostereo", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("tostereo", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -778,14 +778,14 @@ audioop_add(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment1, 'C')) { - _PyArg_BadArgument("add", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("add", "1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &fragment2, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&fragment2, 'C')) { - _PyArg_BadArgument("add", 2, "contiguous buffer", args[1]); + _PyArg_BadArgument("add", "2", "contiguous buffer", args[1]); goto exit; } if (PyFloat_Check(args[2])) { @@ -839,7 +839,7 @@ audioop_bias(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("bias", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("bias", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -897,7 +897,7 @@ audioop_reverse(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("reverse", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("reverse", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -946,7 +946,7 @@ audioop_byteswap(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("byteswap", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("byteswap", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -997,7 +997,7 @@ audioop_lin2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("lin2lin", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("lin2lin", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1064,7 +1064,7 @@ audioop_ratecv(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("ratecv", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("ratecv", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1166,7 +1166,7 @@ audioop_lin2ulaw(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("lin2ulaw", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("lin2ulaw", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1215,7 +1215,7 @@ audioop_ulaw2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("ulaw2lin", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("ulaw2lin", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1264,7 +1264,7 @@ audioop_lin2alaw(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("lin2alaw", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("lin2alaw", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1313,7 +1313,7 @@ audioop_alaw2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("alaw2lin", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("alaw2lin", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1364,7 +1364,7 @@ audioop_lin2adpcm(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("lin2adpcm", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("lin2adpcm", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1416,7 +1416,7 @@ audioop_adpcm2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("adpcm2lin", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("adpcm2lin", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1439,4 +1439,4 @@ audioop_adpcm2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) return return_value; } -/*[clinic end generated code: output=2b173a25726252e9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ef58fafc4686726a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/binascii.c.h b/Modules/clinic/binascii.c.h index 4043d89d97db3b..2df2acc8a3567a 100644 --- a/Modules/clinic/binascii.c.h +++ b/Modules/clinic/binascii.c.h @@ -64,7 +64,7 @@ binascii_b2a_uu(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_uu", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("b2a_uu", "1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -153,7 +153,7 @@ binascii_b2a_base64(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_base64", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("b2a_base64", "1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -233,7 +233,7 @@ binascii_rlecode_hqx(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("rlecode_hqx", 0, "contiguous buffer", arg); + _PyArg_BadArgument("rlecode_hqx", "0", "contiguous buffer", arg); goto exit; } return_value = binascii_rlecode_hqx_impl(module, &data); @@ -269,7 +269,7 @@ binascii_b2a_hqx(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_hqx", 0, "contiguous buffer", arg); + _PyArg_BadArgument("b2a_hqx", "0", "contiguous buffer", arg); goto exit; } return_value = binascii_b2a_hqx_impl(module, &data); @@ -305,7 +305,7 @@ binascii_rledecode_hqx(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("rledecode_hqx", 0, "contiguous buffer", arg); + _PyArg_BadArgument("rledecode_hqx", "0", "contiguous buffer", arg); goto exit; } return_value = binascii_rledecode_hqx_impl(module, &data); @@ -346,7 +346,7 @@ binascii_crc_hqx(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("crc_hqx", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("crc_hqx", "1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -400,7 +400,7 @@ binascii_crc32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("crc32", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("crc32", "1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -456,7 +456,7 @@ binascii_b2a_hex(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_hex", 0, "contiguous buffer", arg); + _PyArg_BadArgument("b2a_hex", "0", "contiguous buffer", arg); goto exit; } return_value = binascii_b2a_hex_impl(module, &data); @@ -494,7 +494,7 @@ binascii_hexlify(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("hexlify", 0, "contiguous buffer", arg); + _PyArg_BadArgument("hexlify", "0", "contiguous buffer", arg); goto exit; } return_value = binascii_hexlify_impl(module, &data); @@ -666,7 +666,7 @@ binascii_b2a_qp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_qp", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("b2a_qp", "1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -720,4 +720,4 @@ binascii_b2a_qp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj return return_value; } -/*[clinic end generated code: output=a4a38e162605aca2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e588f90dd9417f46 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/grpmodule.c.h b/Modules/clinic/grpmodule.c.h index ae99c50955f648..8d46fbe8a50bfa 100644 --- a/Modules/clinic/grpmodule.c.h +++ b/Modules/clinic/grpmodule.c.h @@ -64,7 +64,7 @@ grp_getgrnam(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("getgrnam", 1, "str", args[0]); + _PyArg_BadArgument("getgrnam", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -97,4 +97,4 @@ grp_getgrall(PyObject *module, PyObject *Py_UNUSED(ignored)) { return grp_getgrall_impl(module); } -/*[clinic end generated code: output=2aa6c60873d41ee8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=07535b7468ff0486 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/itertoolsmodule.c.h b/Modules/clinic/itertoolsmodule.c.h index b43ce64af0dc43..be52f5247d626b 100644 --- a/Modules/clinic/itertoolsmodule.c.h +++ b/Modules/clinic/itertoolsmodule.c.h @@ -66,7 +66,7 @@ itertools__grouper(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyObject_TypeCheck(PyTuple_GET_ITEM(args, 0), &groupby_type)) { - _PyArg_BadArgument("_grouper", 1, (&groupby_type)->tp_name, PyTuple_GET_ITEM(args, 0)); + _PyArg_BadArgument("_grouper", "1", (&groupby_type)->tp_name, PyTuple_GET_ITEM(args, 0)); goto exit; } parent = PyTuple_GET_ITEM(args, 0); @@ -104,7 +104,7 @@ itertools_teedataobject(PyTypeObject *type, PyObject *args, PyObject *kwargs) } it = PyTuple_GET_ITEM(args, 0); if (!PyList_Check(PyTuple_GET_ITEM(args, 1))) { - _PyArg_BadArgument("teedataobject", 2, "list", PyTuple_GET_ITEM(args, 1)); + _PyArg_BadArgument("teedataobject", "2", "list", PyTuple_GET_ITEM(args, 1)); goto exit; } values = PyTuple_GET_ITEM(args, 1); @@ -642,4 +642,4 @@ itertools_count(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=04c49debcae96003 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=127c01cc3ac5ab8d input=a9049054013a1b77]*/ diff --git a/Modules/clinic/mathmodule.c.h b/Modules/clinic/mathmodule.c.h index e677bd896cd885..f589e1c26becf9 100644 --- a/Modules/clinic/mathmodule.c.h +++ b/Modules/clinic/mathmodule.c.h @@ -320,12 +320,12 @@ math_dist(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyTuple_Check(args[0])) { - _PyArg_BadArgument("dist", 1, "tuple", args[0]); + _PyArg_BadArgument("dist", "1", "tuple", args[0]); goto exit; } p = args[0]; if (!PyTuple_Check(args[1])) { - _PyArg_BadArgument("dist", 2, "tuple", args[1]); + _PyArg_BadArgument("dist", "2", "tuple", args[1]); goto exit; } q = args[1]; @@ -637,4 +637,4 @@ math_prod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k exit: return return_value; } -/*[clinic end generated code: output=aeed62f403b90199 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3bcbaf1c1f729d06 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index f2745591b2353d..f593b05d47762a 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -616,7 +616,7 @@ os_chflags(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * goto exit; } if (!PyLong_Check(args[1])) { - _PyArg_BadArgument("chflags", 2, "int", args[1]); + _PyArg_BadArgument("chflags", "2", "int", args[1]); goto exit; } flags = PyLong_AsUnsignedLongMask(args[1]); @@ -674,7 +674,7 @@ os_lchflags(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyLong_Check(args[1])) { - _PyArg_BadArgument("lchflags", 2, "int", args[1]); + _PyArg_BadArgument("lchflags", "2", "int", args[1]); goto exit; } flags = PyLong_AsUnsignedLongMask(args[1]); @@ -4969,7 +4969,7 @@ os_write(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("write", 2, "contiguous buffer", args[1]); + _PyArg_BadArgument("write", "2", "contiguous buffer", args[1]); goto exit; } _return_value = os_write_impl(module, fd, &data); @@ -5292,7 +5292,7 @@ os_pwrite(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("pwrite", 2, "contiguous buffer", args[1]); + _PyArg_BadArgument("pwrite", "2", "contiguous buffer", args[1]); goto exit; } if (!Py_off_t_converter(args[2], &offset)) { @@ -5923,7 +5923,7 @@ os_putenv(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("putenv", 1, "str", args[0]); + _PyArg_BadArgument("putenv", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -5931,7 +5931,7 @@ os_putenv(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } name = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("putenv", 2, "str", args[1]); + _PyArg_BadArgument("putenv", "2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -7127,7 +7127,7 @@ os_setxattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyBuffer_IsContiguous(&value, 'C')) { - _PyArg_BadArgument("setxattr", 3, "contiguous buffer", args[2]); + _PyArg_BadArgument("setxattr", "3", "contiguous buffer", args[2]); goto exit; } if (!noptargs) { @@ -8576,4 +8576,4 @@ os__remove_dll_directory(PyObject *module, PyObject *const *args, Py_ssize_t nar #ifndef OS__REMOVE_DLL_DIRECTORY_METHODDEF #define OS__REMOVE_DLL_DIRECTORY_METHODDEF #endif /* !defined(OS__REMOVE_DLL_DIRECTORY_METHODDEF) */ -/*[clinic end generated code: output=5ee9420fb2e7aa2c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d7bb4ce48171e64a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/pwdmodule.c.h b/Modules/clinic/pwdmodule.c.h index cf84ec959d58cc..ab4f20d9fbda04 100644 --- a/Modules/clinic/pwdmodule.c.h +++ b/Modules/clinic/pwdmodule.c.h @@ -34,7 +34,7 @@ pwd_getpwnam(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("getpwnam", 0, "str", arg); + _PyArg_BadArgument("getpwnam", "0", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -74,4 +74,4 @@ pwd_getpwall(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef PWD_GETPWALL_METHODDEF #define PWD_GETPWALL_METHODDEF #endif /* !defined(PWD_GETPWALL_METHODDEF) */ -/*[clinic end generated code: output=f9412bdedc69706c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=aae9a68994c7270f input=a9049054013a1b77]*/ diff --git a/Modules/clinic/pyexpat.c.h b/Modules/clinic/pyexpat.c.h index dfb27d5f111418..2428246a2f83b5 100644 --- a/Modules/clinic/pyexpat.c.h +++ b/Modules/clinic/pyexpat.c.h @@ -75,7 +75,7 @@ pyexpat_xmlparser_SetBase(xmlparseobject *self, PyObject *arg) const char *base; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("SetBase", 0, "str", arg); + _PyArg_BadArgument("SetBase", "0", "str", arg); goto exit; } Py_ssize_t base_length; @@ -171,14 +171,14 @@ pyexpat_xmlparser_ExternalEntityParserCreate(xmlparseobject *self, PyObject *con } } else { - _PyArg_BadArgument("ExternalEntityParserCreate", 1, "str or None", args[0]); + _PyArg_BadArgument("ExternalEntityParserCreate", "1", "str or None", args[0]); goto exit; } if (nargs < 2) { goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("ExternalEntityParserCreate", 2, "str", args[1]); + _PyArg_BadArgument("ExternalEntityParserCreate", "2", "str", args[1]); goto exit; } Py_ssize_t encoding_length; @@ -327,7 +327,7 @@ pyexpat_ParserCreate(PyObject *module, PyObject *const *args, Py_ssize_t nargs, } } else { - _PyArg_BadArgument("ParserCreate", 1, "str or None", args[0]); + _PyArg_BadArgument("ParserCreate", "1", "str or None", args[0]); goto exit; } if (!--noptargs) { @@ -350,7 +350,7 @@ pyexpat_ParserCreate(PyObject *module, PyObject *const *args, Py_ssize_t nargs, } } else { - _PyArg_BadArgument("ParserCreate", 2, "str or None", args[1]); + _PyArg_BadArgument("ParserCreate", "2", "str or None", args[1]); goto exit; } if (!--noptargs) { @@ -401,4 +401,4 @@ pyexpat_ErrorString(PyObject *module, PyObject *arg) #ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */ -/*[clinic end generated code: output=e48f37d326956bdd input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f85b6561bab73301 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/signalmodule.c.h b/Modules/clinic/signalmodule.c.h index bc46515cb436bd..c1028309218281 100644 --- a/Modules/clinic/signalmodule.c.h +++ b/Modules/clinic/signalmodule.c.h @@ -590,7 +590,7 @@ signal_pthread_kill(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyLong_Check(args[0])) { - _PyArg_BadArgument("pthread_kill", 1, "int", args[0]); + _PyArg_BadArgument("pthread_kill", "1", "int", args[0]); goto exit; } thread_id = PyLong_AsUnsignedLongMask(args[0]); @@ -658,4 +658,4 @@ signal_pthread_kill(PyObject *module, PyObject *const *args, Py_ssize_t nargs) #ifndef SIGNAL_PTHREAD_KILL_METHODDEF #define SIGNAL_PTHREAD_KILL_METHODDEF #endif /* !defined(SIGNAL_PTHREAD_KILL_METHODDEF) */ -/*[clinic end generated code: output=f0d3a5703581da76 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=00e33cc3cc3277f8 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/spwdmodule.c.h b/Modules/clinic/spwdmodule.c.h index e051e6eb658992..1219ba859971af 100644 --- a/Modules/clinic/spwdmodule.c.h +++ b/Modules/clinic/spwdmodule.c.h @@ -25,7 +25,7 @@ spwd_getspnam(PyObject *module, PyObject *arg_) PyObject *arg; if (!PyUnicode_Check(arg_)) { - _PyArg_BadArgument("getspnam", 0, "str", arg_); + _PyArg_BadArgument("getspnam", "0", "str", arg_); goto exit; } if (PyUnicode_READY(arg_) == -1) { @@ -71,4 +71,4 @@ spwd_getspall(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef SPWD_GETSPALL_METHODDEF #define SPWD_GETSPALL_METHODDEF #endif /* !defined(SPWD_GETSPALL_METHODDEF) */ -/*[clinic end generated code: output=2bbaa6bab1d9116e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0d4d1a46591b2a15 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/symtablemodule.c.h b/Modules/clinic/symtablemodule.c.h index 73e340bd462a63..43f710a45d4eba 100644 --- a/Modules/clinic/symtablemodule.c.h +++ b/Modules/clinic/symtablemodule.c.h @@ -27,7 +27,7 @@ _symtable_symtable(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("symtable", 1, "str", args[0]); + _PyArg_BadArgument("symtable", "1", "str", args[0]); goto exit; } Py_ssize_t str_length; @@ -43,7 +43,7 @@ _symtable_symtable(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("symtable", 3, "str", args[2]); + _PyArg_BadArgument("symtable", "3", "str", args[2]); goto exit; } Py_ssize_t startstr_length; @@ -60,4 +60,4 @@ _symtable_symtable(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=be1cca59de019984 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=49168d43735b01d9 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/unicodedata.c.h b/Modules/clinic/unicodedata.c.h index 8ca0881efcf8b2..e018ea0b060e28 100644 --- a/Modules/clinic/unicodedata.c.h +++ b/Modules/clinic/unicodedata.c.h @@ -30,14 +30,14 @@ unicodedata_UCD_decimal(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("decimal", 1, "a unicode character", args[0]); + _PyArg_BadArgument("decimal", "1", "a unicode character", args[0]); goto exit; } if (PyUnicode_READY(args[0])) { goto exit; } if (PyUnicode_GET_LENGTH(args[0]) != 1) { - _PyArg_BadArgument("decimal", 1, "a unicode character", args[0]); + _PyArg_BadArgument("decimal", "1", "a unicode character", args[0]); goto exit; } chr = PyUnicode_READ_CHAR(args[0], 0); @@ -79,14 +79,14 @@ unicodedata_UCD_digit(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("digit", 1, "a unicode character", args[0]); + _PyArg_BadArgument("digit", "1", "a unicode character", args[0]); goto exit; } if (PyUnicode_READY(args[0])) { goto exit; } if (PyUnicode_GET_LENGTH(args[0]) != 1) { - _PyArg_BadArgument("digit", 1, "a unicode character", args[0]); + _PyArg_BadArgument("digit", "1", "a unicode character", args[0]); goto exit; } chr = PyUnicode_READ_CHAR(args[0], 0); @@ -129,14 +129,14 @@ unicodedata_UCD_numeric(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("numeric", 1, "a unicode character", args[0]); + _PyArg_BadArgument("numeric", "1", "a unicode character", args[0]); goto exit; } if (PyUnicode_READY(args[0])) { goto exit; } if (PyUnicode_GET_LENGTH(args[0]) != 1) { - _PyArg_BadArgument("numeric", 1, "a unicode character", args[0]); + _PyArg_BadArgument("numeric", "1", "a unicode character", args[0]); goto exit; } chr = PyUnicode_READ_CHAR(args[0], 0); @@ -170,14 +170,14 @@ unicodedata_UCD_category(PyObject *self, PyObject *arg) int chr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("category", 0, "a unicode character", arg); + _PyArg_BadArgument("category", "0", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("category", 0, "a unicode character", arg); + _PyArg_BadArgument("category", "0", "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -208,14 +208,14 @@ unicodedata_UCD_bidirectional(PyObject *self, PyObject *arg) int chr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("bidirectional", 0, "a unicode character", arg); + _PyArg_BadArgument("bidirectional", "0", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("bidirectional", 0, "a unicode character", arg); + _PyArg_BadArgument("bidirectional", "0", "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -247,14 +247,14 @@ unicodedata_UCD_combining(PyObject *self, PyObject *arg) int _return_value; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("combining", 0, "a unicode character", arg); + _PyArg_BadArgument("combining", "0", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("combining", 0, "a unicode character", arg); + _PyArg_BadArgument("combining", "0", "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -291,14 +291,14 @@ unicodedata_UCD_mirrored(PyObject *self, PyObject *arg) int _return_value; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("mirrored", 0, "a unicode character", arg); + _PyArg_BadArgument("mirrored", "0", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("mirrored", 0, "a unicode character", arg); + _PyArg_BadArgument("mirrored", "0", "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -331,14 +331,14 @@ unicodedata_UCD_east_asian_width(PyObject *self, PyObject *arg) int chr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("east_asian_width", 0, "a unicode character", arg); + _PyArg_BadArgument("east_asian_width", "0", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("east_asian_width", 0, "a unicode character", arg); + _PyArg_BadArgument("east_asian_width", "0", "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -369,14 +369,14 @@ unicodedata_UCD_decomposition(PyObject *self, PyObject *arg) int chr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("decomposition", 0, "a unicode character", arg); + _PyArg_BadArgument("decomposition", "0", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("decomposition", 0, "a unicode character", arg); + _PyArg_BadArgument("decomposition", "0", "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -412,7 +412,7 @@ unicodedata_UCD_is_normalized(PyObject *self, PyObject *const *args, Py_ssize_t goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("is_normalized", 1, "str", args[0]); + _PyArg_BadArgument("is_normalized", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -420,7 +420,7 @@ unicodedata_UCD_is_normalized(PyObject *self, PyObject *const *args, Py_ssize_t } form = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("is_normalized", 2, "str", args[1]); + _PyArg_BadArgument("is_normalized", "2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -459,7 +459,7 @@ unicodedata_UCD_normalize(PyObject *self, PyObject *const *args, Py_ssize_t narg goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("normalize", 1, "str", args[0]); + _PyArg_BadArgument("normalize", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -467,7 +467,7 @@ unicodedata_UCD_normalize(PyObject *self, PyObject *const *args, Py_ssize_t narg } form = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("normalize", 2, "str", args[1]); + _PyArg_BadArgument("normalize", "2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -506,14 +506,14 @@ unicodedata_UCD_name(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("name", 1, "a unicode character", args[0]); + _PyArg_BadArgument("name", "1", "a unicode character", args[0]); goto exit; } if (PyUnicode_READY(args[0])) { goto exit; } if (PyUnicode_GET_LENGTH(args[0]) != 1) { - _PyArg_BadArgument("name", 1, "a unicode character", args[0]); + _PyArg_BadArgument("name", "1", "a unicode character", args[0]); goto exit; } chr = PyUnicode_READ_CHAR(args[0], 0); @@ -559,4 +559,4 @@ unicodedata_UCD_lookup(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=0fc850fe5b6b312c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=69adbc05d6796def input=a9049054013a1b77]*/ diff --git a/Modules/clinic/zlibmodule.c.h b/Modules/clinic/zlibmodule.c.h index aa579209108d85..1aa753ed7de0c9 100644 --- a/Modules/clinic/zlibmodule.c.h +++ b/Modules/clinic/zlibmodule.c.h @@ -38,7 +38,7 @@ zlib_compress(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("compress", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("compress", "1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -105,7 +105,7 @@ zlib_decompress(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("decompress", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("decompress", "1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -273,7 +273,7 @@ zlib_compressobj(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb goto exit; } if (!PyBuffer_IsContiguous(&zdict, 'C')) { - _PyArg_BadArgument("compressobj", 6, "contiguous buffer", args[5]); + _PyArg_BadArgument("compressobj", "6", "contiguous buffer", args[5]); goto exit; } skip_optional_pos: @@ -375,7 +375,7 @@ zlib_Compress_compress(compobject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("compress", 0, "contiguous buffer", arg); + _PyArg_BadArgument("compress", "0", "contiguous buffer", arg); goto exit; } return_value = zlib_Compress_compress_impl(self, &data); @@ -432,7 +432,7 @@ zlib_Decompress_decompress(compobject *self, PyObject *const *args, Py_ssize_t n goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("decompress", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("decompress", "1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -677,7 +677,7 @@ zlib_adler32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("adler32", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("adler32", "1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -735,7 +735,7 @@ zlib_crc32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("crc32", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("crc32", "1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -785,4 +785,4 @@ zlib_crc32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) #ifndef ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF #define ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF #endif /* !defined(ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF) */ -/*[clinic end generated code: output=feb079cebbbaacd6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b2ce5de6c650004c input=a9049054013a1b77]*/ diff --git a/Objects/clinic/bytearrayobject.c.h b/Objects/clinic/bytearrayobject.c.h index da1dc6a40af0a3..7dd1f88b47edb8 100644 --- a/Objects/clinic/bytearrayobject.c.h +++ b/Objects/clinic/bytearrayobject.c.h @@ -115,14 +115,14 @@ bytearray_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&frm, 'C')) { - _PyArg_BadArgument("maketrans", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("maketrans", "1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &to, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&to, 'C')) { - _PyArg_BadArgument("maketrans", 2, "contiguous buffer", args[1]); + _PyArg_BadArgument("maketrans", "2", "contiguous buffer", args[1]); goto exit; } return_value = bytearray_maketrans_impl(&frm, &to); @@ -175,14 +175,14 @@ bytearray_replace(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&old, 'C')) { - _PyArg_BadArgument("replace", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("replace", "1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &new, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&new, 'C')) { - _PyArg_BadArgument("replace", 2, "contiguous buffer", args[1]); + _PyArg_BadArgument("replace", "2", "contiguous buffer", args[1]); goto exit; } if (nargs < 3) { @@ -735,7 +735,7 @@ bytearray_decode(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t narg } if (args[0]) { if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("decode", 1, "str", args[0]); + _PyArg_BadArgument("decode", "1", "str", args[0]); goto exit; } Py_ssize_t encoding_length; @@ -752,7 +752,7 @@ bytearray_decode(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t narg } } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("decode", 2, "str", args[1]); + _PyArg_BadArgument("decode", "2", "str", args[1]); goto exit; } Py_ssize_t errors_length; @@ -854,7 +854,7 @@ bytearray_fromhex(PyTypeObject *type, PyObject *arg) PyObject *string; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("fromhex", 0, "str", arg); + _PyArg_BadArgument("fromhex", "0", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -942,4 +942,4 @@ bytearray_sizeof(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored)) { return bytearray_sizeof_impl(self); } -/*[clinic end generated code: output=272fcb836b92da32 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=16387cbb8b23fbc2 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/bytesobject.c.h b/Objects/clinic/bytesobject.c.h index b03078305a6006..590d82f4cbc558 100644 --- a/Objects/clinic/bytesobject.c.h +++ b/Objects/clinic/bytesobject.c.h @@ -99,7 +99,7 @@ bytes_partition(PyBytesObject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&sep, 'C')) { - _PyArg_BadArgument("partition", 0, "contiguous buffer", arg); + _PyArg_BadArgument("partition", "0", "contiguous buffer", arg); goto exit; } return_value = bytes_partition_impl(self, &sep); @@ -142,7 +142,7 @@ bytes_rpartition(PyBytesObject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&sep, 'C')) { - _PyArg_BadArgument("rpartition", 0, "contiguous buffer", arg); + _PyArg_BadArgument("rpartition", "0", "contiguous buffer", arg); goto exit; } return_value = bytes_rpartition_impl(self, &sep); @@ -420,14 +420,14 @@ bytes_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&frm, 'C')) { - _PyArg_BadArgument("maketrans", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("maketrans", "1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &to, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&to, 'C')) { - _PyArg_BadArgument("maketrans", 2, "contiguous buffer", args[1]); + _PyArg_BadArgument("maketrans", "2", "contiguous buffer", args[1]); goto exit; } return_value = bytes_maketrans_impl(&frm, &to); @@ -480,14 +480,14 @@ bytes_replace(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&old, 'C')) { - _PyArg_BadArgument("replace", 1, "contiguous buffer", args[0]); + _PyArg_BadArgument("replace", "1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &new, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&new, 'C')) { - _PyArg_BadArgument("replace", 2, "contiguous buffer", args[1]); + _PyArg_BadArgument("replace", "2", "contiguous buffer", args[1]); goto exit; } if (nargs < 3) { @@ -568,7 +568,7 @@ bytes_decode(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObj } if (args[0]) { if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("decode", 1, "str", args[0]); + _PyArg_BadArgument("decode", "1", "str", args[0]); goto exit; } Py_ssize_t encoding_length; @@ -585,7 +585,7 @@ bytes_decode(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObj } } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("decode", 2, "str", args[1]); + _PyArg_BadArgument("decode", "2", "str", args[1]); goto exit; } Py_ssize_t errors_length; @@ -674,7 +674,7 @@ bytes_fromhex(PyTypeObject *type, PyObject *arg) PyObject *string; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("fromhex", 0, "str", arg); + _PyArg_BadArgument("fromhex", "0", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -686,4 +686,4 @@ bytes_fromhex(PyTypeObject *type, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=af9f51b9b185567d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=88b6905912e52b93 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/codeobject.c.h b/Objects/clinic/codeobject.c.h index ec127ce1718980..0761f9aa707c8f 100644 --- a/Objects/clinic/codeobject.c.h +++ b/Objects/clinic/codeobject.c.h @@ -158,7 +158,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[7]) { if (!PyBytes_Check(args[7])) { - _PyArg_BadArgument("replace", 8, "bytes", args[7]); + _PyArg_BadArgument("replace", "'co_code'", "bytes", args[7]); goto exit; } co_code = (PyBytesObject *)args[7]; @@ -168,7 +168,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[8]) { if (!PyTuple_Check(args[8])) { - _PyArg_BadArgument("replace", 9, "tuple", args[8]); + _PyArg_BadArgument("replace", "'co_consts'", "tuple", args[8]); goto exit; } co_consts = args[8]; @@ -178,7 +178,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[9]) { if (!PyTuple_Check(args[9])) { - _PyArg_BadArgument("replace", 10, "tuple", args[9]); + _PyArg_BadArgument("replace", "'co_names'", "tuple", args[9]); goto exit; } co_names = args[9]; @@ -188,7 +188,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[10]) { if (!PyTuple_Check(args[10])) { - _PyArg_BadArgument("replace", 11, "tuple", args[10]); + _PyArg_BadArgument("replace", "'co_varnames'", "tuple", args[10]); goto exit; } co_varnames = args[10]; @@ -198,7 +198,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[11]) { if (!PyTuple_Check(args[11])) { - _PyArg_BadArgument("replace", 12, "tuple", args[11]); + _PyArg_BadArgument("replace", "'co_freevars'", "tuple", args[11]); goto exit; } co_freevars = args[11]; @@ -208,7 +208,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[12]) { if (!PyTuple_Check(args[12])) { - _PyArg_BadArgument("replace", 13, "tuple", args[12]); + _PyArg_BadArgument("replace", "'co_cellvars'", "tuple", args[12]); goto exit; } co_cellvars = args[12]; @@ -218,7 +218,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[13]) { if (!PyUnicode_Check(args[13])) { - _PyArg_BadArgument("replace", 14, "str", args[13]); + _PyArg_BadArgument("replace", "'co_filename'", "str", args[13]); goto exit; } if (PyUnicode_READY(args[13]) == -1) { @@ -231,7 +231,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[14]) { if (!PyUnicode_Check(args[14])) { - _PyArg_BadArgument("replace", 15, "str", args[14]); + _PyArg_BadArgument("replace", "'co_name'", "str", args[14]); goto exit; } if (PyUnicode_READY(args[14]) == -1) { @@ -243,7 +243,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } } if (!PyBytes_Check(args[15])) { - _PyArg_BadArgument("replace", 16, "bytes", args[15]); + _PyArg_BadArgument("replace", "'co_lnotab'", "bytes", args[15]); goto exit; } co_lnotab = (PyBytesObject *)args[15]; @@ -253,4 +253,4 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje exit: return return_value; } -/*[clinic end generated code: output=624ab6f2ea8f0ea4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=42e00fc97bcf657b input=a9049054013a1b77]*/ diff --git a/Objects/clinic/floatobject.c.h b/Objects/clinic/floatobject.c.h index 4251d63c247b9f..82bcde2f4c2401 100644 --- a/Objects/clinic/floatobject.c.h +++ b/Objects/clinic/floatobject.c.h @@ -235,7 +235,7 @@ float___getformat__(PyTypeObject *type, PyObject *arg) const char *typestr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__getformat__", 0, "str", arg); + _PyArg_BadArgument("__getformat__", "0", "str", arg); goto exit; } Py_ssize_t typestr_length; @@ -289,7 +289,7 @@ float___set_format__(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("__set_format__", 1, "str", args[0]); + _PyArg_BadArgument("__set_format__", "1", "str", args[0]); goto exit; } Py_ssize_t typestr_length; @@ -302,7 +302,7 @@ float___set_format__(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("__set_format__", 2, "str", args[1]); + _PyArg_BadArgument("__set_format__", "2", "str", args[1]); goto exit; } Py_ssize_t fmt_length; @@ -339,7 +339,7 @@ float___format__(PyObject *self, PyObject *arg) PyObject *format_spec; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__format__", 0, "str", arg); + _PyArg_BadArgument("__format__", "0", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -351,4 +351,4 @@ float___format__(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=c183029d87dd41fa input=a9049054013a1b77]*/ +/*[clinic end generated code: output=eff900d4dec282e3 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/funcobject.c.h b/Objects/clinic/funcobject.c.h index 929797bfb02d1a..530e9c769c95a9 100644 --- a/Objects/clinic/funcobject.c.h +++ b/Objects/clinic/funcobject.c.h @@ -44,12 +44,12 @@ func_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyObject_TypeCheck(fastargs[0], &PyCode_Type)) { - _PyArg_BadArgument("function", 1, (&PyCode_Type)->tp_name, fastargs[0]); + _PyArg_BadArgument("function", "1", (&PyCode_Type)->tp_name, fastargs[0]); goto exit; } code = (PyCodeObject *)fastargs[0]; if (!PyDict_Check(fastargs[1])) { - _PyArg_BadArgument("function", 2, "dict", fastargs[1]); + _PyArg_BadArgument("function", "2", "dict", fastargs[1]); goto exit; } globals = fastargs[1]; @@ -75,4 +75,4 @@ func_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=1d01072cd5620d7e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9a4d09e5f261161d input=a9049054013a1b77]*/ diff --git a/Objects/clinic/longobject.c.h b/Objects/clinic/longobject.c.h index 453edba481dfb5..fa32c3588f913d 100644 --- a/Objects/clinic/longobject.c.h +++ b/Objects/clinic/longobject.c.h @@ -74,7 +74,7 @@ int___format__(PyObject *self, PyObject *arg) PyObject *format_spec; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__format__", 0, "str", arg); + _PyArg_BadArgument("__format__", "0", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -227,7 +227,7 @@ int_to_bytes(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject * length = ival; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("to_bytes", 2, "str", args[1]); + _PyArg_BadArgument("to_bytes", "2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -293,7 +293,7 @@ int_from_bytes(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs, PyOb } bytes_obj = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("from_bytes", 2, "str", args[1]); + _PyArg_BadArgument("from_bytes", "2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -313,4 +313,4 @@ int_from_bytes(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs, PyOb exit: return return_value; } -/*[clinic end generated code: output=709503897c55bca1 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4b43f543f581a14f input=a9049054013a1b77]*/ diff --git a/Objects/clinic/moduleobject.c.h b/Objects/clinic/moduleobject.c.h index 512edee72feaa2..8effaa39d870d0 100644 --- a/Objects/clinic/moduleobject.c.h +++ b/Objects/clinic/moduleobject.c.h @@ -31,7 +31,7 @@ module___init__(PyObject *self, PyObject *args, PyObject *kwargs) goto exit; } if (!PyUnicode_Check(fastargs[0])) { - _PyArg_BadArgument("module", 1, "str", fastargs[0]); + _PyArg_BadArgument("module", "1", "str", fastargs[0]); goto exit; } if (PyUnicode_READY(fastargs[0]) == -1) { @@ -48,4 +48,4 @@ module___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=d7b7ca1237597b08 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dfd4f10143cfe989 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/typeobject.c.h b/Objects/clinic/typeobject.c.h index fbe1261fb5a062..865df4d4945df9 100644 --- a/Objects/clinic/typeobject.c.h +++ b/Objects/clinic/typeobject.c.h @@ -200,7 +200,7 @@ object___format__(PyObject *self, PyObject *arg) PyObject *format_spec; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__format__", 0, "str", arg); + _PyArg_BadArgument("__format__", "0", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -248,4 +248,4 @@ object___dir__(PyObject *self, PyObject *Py_UNUSED(ignored)) { return object___dir___impl(self); } -/*[clinic end generated code: output=ea5734413064fa7e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=926ed3341450acda input=a9049054013a1b77]*/ diff --git a/Objects/clinic/unicodeobject.c.h b/Objects/clinic/unicodeobject.c.h index 647507dea61a48..a0d040f02b6913 100644 --- a/Objects/clinic/unicodeobject.c.h +++ b/Objects/clinic/unicodeobject.c.h @@ -157,7 +157,7 @@ unicode_encode(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject } if (args[0]) { if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("encode", 1, "str", args[0]); + _PyArg_BadArgument("encode", "1", "str", args[0]); goto exit; } Py_ssize_t encoding_length; @@ -174,7 +174,7 @@ unicode_encode(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject } } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("encode", 2, "str", args[1]); + _PyArg_BadArgument("encode", "2", "str", args[1]); goto exit; } Py_ssize_t errors_length; @@ -712,7 +712,7 @@ unicode_replace(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("replace", 1, "str", args[0]); + _PyArg_BadArgument("replace", "1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -720,7 +720,7 @@ unicode_replace(PyObject *self, PyObject *const *args, Py_ssize_t nargs) } old = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("replace", 2, "str", args[1]); + _PyArg_BadArgument("replace", "2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -1080,7 +1080,7 @@ unicode_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("maketrans", 2, "str", args[1]); + _PyArg_BadArgument("maketrans", "2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -1091,7 +1091,7 @@ unicode_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("maketrans", 3, "str", args[2]); + _PyArg_BadArgument("maketrans", "3", "str", args[2]); goto exit; } if (PyUnicode_READY(args[2]) == -1) { @@ -1202,7 +1202,7 @@ unicode___format__(PyObject *self, PyObject *arg) PyObject *format_spec; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__format__", 0, "str", arg); + _PyArg_BadArgument("__format__", "0", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -1232,4 +1232,4 @@ unicode_sizeof(PyObject *self, PyObject *Py_UNUSED(ignored)) { return unicode_sizeof_impl(self); } -/*[clinic end generated code: output=d1541724cb4a0070 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9640feea5455211b input=a9049054013a1b77]*/ diff --git a/Objects/stringlib/clinic/transmogrify.h.h b/Objects/stringlib/clinic/transmogrify.h.h index 0c53a75b1bf834..b2e95ab8afba5e 100644 --- a/Objects/stringlib/clinic/transmogrify.h.h +++ b/Objects/stringlib/clinic/transmogrify.h.h @@ -100,7 +100,7 @@ stringlib_ljust(PyObject *self, PyObject *const *args, Py_ssize_t nargs) fillchar = PyByteArray_AS_STRING(args[1])[0]; } else { - _PyArg_BadArgument("ljust", 2, "a byte string of length 1", args[1]); + _PyArg_BadArgument("ljust", "2", "a byte string of length 1", args[1]); goto exit; } skip_optional: @@ -161,7 +161,7 @@ stringlib_rjust(PyObject *self, PyObject *const *args, Py_ssize_t nargs) fillchar = PyByteArray_AS_STRING(args[1])[0]; } else { - _PyArg_BadArgument("rjust", 2, "a byte string of length 1", args[1]); + _PyArg_BadArgument("rjust", "2", "a byte string of length 1", args[1]); goto exit; } skip_optional: @@ -222,7 +222,7 @@ stringlib_center(PyObject *self, PyObject *const *args, Py_ssize_t nargs) fillchar = PyByteArray_AS_STRING(args[1])[0]; } else { - _PyArg_BadArgument("center", 2, "a byte string of length 1", args[1]); + _PyArg_BadArgument("center", "2", "a byte string of length 1", args[1]); goto exit; } skip_optional: @@ -274,4 +274,4 @@ stringlib_zfill(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=96cbb19b238d0e84 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7a8bdc0fb59e99eb input=a9049054013a1b77]*/ diff --git a/PC/clinic/_testconsole.c.h b/PC/clinic/_testconsole.c.h index a37d1235a02a9e..739ca75194d87a 100644 --- a/PC/clinic/_testconsole.c.h +++ b/PC/clinic/_testconsole.c.h @@ -33,7 +33,7 @@ _testconsole_write_input(PyObject *module, PyObject *const *args, Py_ssize_t nar } file = args[0]; if (!PyBytes_Check(args[1])) { - _PyArg_BadArgument("write_input", 2, "bytes", args[1]); + _PyArg_BadArgument("write_input", "2", "bytes", args[1]); goto exit; } s = (PyBytesObject *)args[1]; @@ -88,4 +88,4 @@ _testconsole_read_output(PyObject *module, PyObject *const *args, Py_ssize_t nar #ifndef _TESTCONSOLE_READ_OUTPUT_METHODDEF #define _TESTCONSOLE_READ_OUTPUT_METHODDEF #endif /* !defined(_TESTCONSOLE_READ_OUTPUT_METHODDEF) */ -/*[clinic end generated code: output=ef452d5fb9287fc2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=92f624ac54ce33ff input=a9049054013a1b77]*/ diff --git a/PC/clinic/msvcrtmodule.c.h b/PC/clinic/msvcrtmodule.c.h index d8e77d5f328dda..fd4f034e30ffa0 100644 --- a/PC/clinic/msvcrtmodule.c.h +++ b/PC/clinic/msvcrtmodule.c.h @@ -375,7 +375,7 @@ msvcrt_putch(PyObject *module, PyObject *arg) char_value = PyByteArray_AS_STRING(arg)[0]; } else { - _PyArg_BadArgument("putch", 0, "a byte string of length 1", arg); + _PyArg_BadArgument("putch", "0", "a byte string of length 1", arg); goto exit; } return_value = msvcrt_putch_impl(module, char_value); @@ -403,14 +403,14 @@ msvcrt_putwch(PyObject *module, PyObject *arg) int unicode_char; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("putwch", 0, "a unicode character", arg); + _PyArg_BadArgument("putwch", "0", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("putwch", 0, "a unicode character", arg); + _PyArg_BadArgument("putwch", "0", "a unicode character", arg); goto exit; } unicode_char = PyUnicode_READ_CHAR(arg, 0); @@ -449,7 +449,7 @@ msvcrt_ungetch(PyObject *module, PyObject *arg) char_value = PyByteArray_AS_STRING(arg)[0]; } else { - _PyArg_BadArgument("ungetch", 0, "a byte string of length 1", arg); + _PyArg_BadArgument("ungetch", "0", "a byte string of length 1", arg); goto exit; } return_value = msvcrt_ungetch_impl(module, char_value); @@ -477,14 +477,14 @@ msvcrt_ungetwch(PyObject *module, PyObject *arg) int unicode_char; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("ungetwch", 0, "a unicode character", arg); + _PyArg_BadArgument("ungetwch", "0", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("ungetwch", 0, "a unicode character", arg); + _PyArg_BadArgument("ungetwch", "0", "a unicode character", arg); goto exit; } unicode_char = PyUnicode_READ_CHAR(arg, 0); @@ -679,4 +679,4 @@ msvcrt_SetErrorMode(PyObject *module, PyObject *arg) #ifndef MSVCRT_SET_ERROR_MODE_METHODDEF #define MSVCRT_SET_ERROR_MODE_METHODDEF #endif /* !defined(MSVCRT_SET_ERROR_MODE_METHODDEF) */ -/*[clinic end generated code: output=816bc4f993893cea input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e222ca1443153a37 input=a9049054013a1b77]*/ diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h index 0ed11bceeb87e2..dc8b0f3b1f310a 100644 --- a/Python/clinic/bltinmodule.c.h +++ b/Python/clinic/bltinmodule.c.h @@ -102,7 +102,7 @@ builtin_format(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("format", 2, "str", args[1]); + _PyArg_BadArgument("format", "2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -200,7 +200,7 @@ builtin_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("compile", 3, "str", args[2]); + _PyArg_BadArgument("compile", "3", "str", args[2]); goto exit; } Py_ssize_t mode_length; @@ -845,4 +845,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=3f690311ac556c31 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c4709b74364f9aa7 input=a9049054013a1b77]*/ diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h index 05e3106bb39af0..34020991abbf5c 100644 --- a/Python/clinic/import.c.h +++ b/Python/clinic/import.c.h @@ -92,12 +92,12 @@ _imp__fix_co_filename(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyObject_TypeCheck(args[0], &PyCode_Type)) { - _PyArg_BadArgument("_fix_co_filename", 1, (&PyCode_Type)->tp_name, args[0]); + _PyArg_BadArgument("_fix_co_filename", "1", (&PyCode_Type)->tp_name, args[0]); goto exit; } code = (PyCodeObject *)args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("_fix_co_filename", 2, "str", args[1]); + _PyArg_BadArgument("_fix_co_filename", "2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -156,7 +156,7 @@ _imp_init_frozen(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("init_frozen", 0, "str", arg); + _PyArg_BadArgument("init_frozen", "0", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -188,7 +188,7 @@ _imp_get_frozen_object(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("get_frozen_object", 0, "str", arg); + _PyArg_BadArgument("get_frozen_object", "0", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -220,7 +220,7 @@ _imp_is_frozen_package(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("is_frozen_package", 0, "str", arg); + _PyArg_BadArgument("is_frozen_package", "0", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -252,7 +252,7 @@ _imp_is_builtin(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("is_builtin", 0, "str", arg); + _PyArg_BadArgument("is_builtin", "0", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -284,7 +284,7 @@ _imp_is_frozen(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("is_frozen", 0, "str", arg); + _PyArg_BadArgument("is_frozen", "0", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -433,7 +433,7 @@ _imp_source_hash(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb goto exit; } if (!PyBuffer_IsContiguous(&source, 'C')) { - _PyArg_BadArgument("source_hash", 2, "contiguous buffer", args[1]); + _PyArg_BadArgument("source_hash", "2", "contiguous buffer", args[1]); goto exit; } return_value = _imp_source_hash_impl(module, key, &source); @@ -454,4 +454,4 @@ _imp_source_hash(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #ifndef _IMP_EXEC_DYNAMIC_METHODDEF #define _IMP_EXEC_DYNAMIC_METHODDEF #endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */ -/*[clinic end generated code: output=b51244770fdcf4b8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=da2bfe8965a2c54b input=a9049054013a1b77]*/ diff --git a/Python/clinic/marshal.c.h b/Python/clinic/marshal.c.h index ab4575340e2565..f52c263e8ebe87 100644 --- a/Python/clinic/marshal.c.h +++ b/Python/clinic/marshal.c.h @@ -152,7 +152,7 @@ marshal_loads(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&bytes, 'C')) { - _PyArg_BadArgument("loads", 0, "contiguous buffer", arg); + _PyArg_BadArgument("loads", "0", "contiguous buffer", arg); goto exit; } return_value = marshal_loads_impl(module, &bytes); @@ -165,4 +165,4 @@ marshal_loads(PyObject *module, PyObject *arg) return return_value; } -/*[clinic end generated code: output=ae2bca1aa239e095 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=547a6a9e7afdd98a input=a9049054013a1b77]*/ diff --git a/Python/clinic/sysmodule.c.h b/Python/clinic/sysmodule.c.h index 5df8af1a1172c6..7854acc028a03e 100644 --- a/Python/clinic/sysmodule.c.h +++ b/Python/clinic/sysmodule.c.h @@ -228,7 +228,7 @@ sys_intern(PyObject *module, PyObject *arg) PyObject *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("intern", 0, "str", arg); + _PyArg_BadArgument("intern", "0", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -952,7 +952,7 @@ sys_call_tracing(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } func = args[0]; if (!PyTuple_Check(args[1])) { - _PyArg_BadArgument("call_tracing", 2, "tuple", args[1]); + _PyArg_BadArgument("call_tracing", "2", "tuple", args[1]); goto exit; } funcargs = args[1]; @@ -1109,4 +1109,4 @@ sys_getandroidapilevel(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef SYS_GETANDROIDAPILEVEL_METHODDEF #define SYS_GETANDROIDAPILEVEL_METHODDEF #endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */ -/*[clinic end generated code: output=03da2eb03135d9f2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=abc9ba9f20ce5e83 input=a9049054013a1b77]*/ diff --git a/Python/clinic/traceback.c.h b/Python/clinic/traceback.c.h index 2815f65d3dd1c0..b549d0d25c466d 100644 --- a/Python/clinic/traceback.c.h +++ b/Python/clinic/traceback.c.h @@ -32,7 +32,7 @@ tb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) } tb_next = fastargs[0]; if (!PyObject_TypeCheck(fastargs[1], &PyFrame_Type)) { - _PyArg_BadArgument("TracebackType", 2, (&PyFrame_Type)->tp_name, fastargs[1]); + _PyArg_BadArgument("TracebackType", "2", (&PyFrame_Type)->tp_name, fastargs[1]); goto exit; } tb_frame = (PyFrameObject *)fastargs[1]; @@ -59,4 +59,4 @@ tb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=7e4c0e252d0973b0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e2d163d7f25a6770 input=a9049054013a1b77]*/ diff --git a/Python/getargs.c b/Python/getargs.c index 59f0fdabb74a65..1fefd3a9ce1ac8 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -613,13 +613,13 @@ convertitem(PyObject *arg, const char **p_format, va_list *p_va, int flags, /* Format an error message generated by convertsimple(). */ void -_PyArg_BadArgument(const char *fname, int iarg, +_PyArg_BadArgument(const char *fname, const char *argname, const char *expected, PyObject *arg) { - if (iarg) { + if (argname) { PyErr_Format(PyExc_TypeError, - "%.200s() argument %d must be %.50s, not %.50s", - fname, iarg, expected, + "%.200s() argument %.200s must be %.50s, not %.50s", + fname, argname, expected, arg == Py_None ? "None" : arg->ob_type->tp_name); } else { From 6dfcd1878dfabcb2e7f6e16586b2f53d771a1954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Lapeyre?= Date: Mon, 27 May 2019 16:13:14 +0200 Subject: [PATCH 04/15] Add blurb --- .../next/Tools-Demos/2019-05-27-16-13-08.bpo-37034.zbTgy8.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Tools-Demos/2019-05-27-16-13-08.bpo-37034.zbTgy8.rst diff --git a/Misc/NEWS.d/next/Tools-Demos/2019-05-27-16-13-08.bpo-37034.zbTgy8.rst b/Misc/NEWS.d/next/Tools-Demos/2019-05-27-16-13-08.bpo-37034.zbTgy8.rst new file mode 100644 index 00000000000000..3457789635b4eb --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2019-05-27-16-13-08.bpo-37034.zbTgy8.rst @@ -0,0 +1,2 @@ +Argument Clinic now uses the argument name on errors with keyword-only +argument instead of their position. Patch contributed by Rémi Lapeyre. From 3b19b9bc2b0785ddc7baf5ca92f4729c97aabe15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Lapeyre?= Date: Wed, 29 May 2019 14:52:51 +0200 Subject: [PATCH 05/15] Use both position and argument name in _PyArg_BadArgument() --- Include/modsupport.h | 2 +- Python/getargs.c | 17 ++-- Tools/clinic/clinic.py | 177 +++++++++++++++++++++++------------------ 3 files changed, 109 insertions(+), 87 deletions(-) diff --git a/Include/modsupport.h b/Include/modsupport.h index f90ede4831e32b..2bae263e4b2e8a 100644 --- a/Include/modsupport.h +++ b/Include/modsupport.h @@ -66,7 +66,7 @@ PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args); #define _PyArg_NoPositional(funcname, args) \ ((args) == NULL || _PyArg_NoPositional((funcname), (args))) -PyAPI_FUNC(void) _PyArg_BadArgument(const char *, const char *, const char *, PyObject *); +PyAPI_FUNC(void) _PyArg_BadArgument(const char *, int, const char *, const char *, PyObject *); PyAPI_FUNC(int) _PyArg_CheckPositional(const char *, Py_ssize_t, Py_ssize_t, Py_ssize_t); #define _PyArg_CheckPositional(funcname, nargs, min, max) \ diff --git a/Python/getargs.c b/Python/getargs.c index 1fefd3a9ce1ac8..6a656403a311d0 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -613,20 +613,19 @@ convertitem(PyObject *arg, const char **p_format, va_list *p_va, int flags, /* Format an error message generated by convertsimple(). */ void -_PyArg_BadArgument(const char *fname, const char *argname, +_PyArg_BadArgument(const char *fname, int iarg, const char *argname, const char *expected, PyObject *arg) { if (argname) { PyErr_Format(PyExc_TypeError, - "%.200s() argument %.200s must be %.50s, not %.50s", - fname, argname, expected, - arg == Py_None ? "None" : arg->ob_type->tp_name); - } - else { + "%.200s() argument '%.200s' must be %.50s, not %.50s", + fname, argname, expected, + arg == Py_None ? "None" : arg->ob_type->tp_name); + } else { PyErr_Format(PyExc_TypeError, - "%.200s() argument must be %.50s, not %.50s", - fname, expected, - arg == Py_None ? "None" : arg->ob_type->tp_name); + "%.200s() argument %d must be %.50s, not %.50s", + fname, iarg, expected, + arg == Py_None ? "None" : arg->ob_type->tp_name); } } diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index f6f8704ba6448f..7cb589c211ce51 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -806,7 +806,8 @@ def parser_body(prototype, *fields, declarations=''): {c_basename}({self_type}{self_name}, PyObject *%s) """ % argname) - parsearg = converters[0].parse_arg(argname, 0) + displayname = parameters[0].displayname() + parsearg = converters[0].parse_arg(argname, 0, displayname) if parsearg is None: parsearg = """ if (!PyArg_Parse(%s, "{format_units}:{name}", {parse_arguments})) {{ @@ -851,8 +852,8 @@ def parser_body(prototype, *fields, declarations=''): """ % (nargs, min_pos, max_pos), indent=4)] has_optional = False for i, p in enumerate(parameters): - argnum = repr(p.name) if p.is_keyword_only() else str(i + 1) - parsearg = p.converter.parse_arg(argname_fmt % i, argnum) + displayname = p.displayname() + parsearg = p.converter.parse_arg(argname_fmt % i, i + 1, displayname) if parsearg is None: #print('Cannot convert %s %r for %s' % (p.converter.__class__.__name__, p.converter.format_unit, p.converter.name), file=sys.stderr) parser_code = None @@ -928,8 +929,8 @@ def parser_body(prototype, *fields, declarations=''): add_label = None for i, p in enumerate(parameters): - argnum = repr(p.name) if p.is_keyword_only() else str(i + 1) - parsearg = p.converter.parse_arg(argname_fmt % i, argnum) + displayname = p.displayname() + parsearg = p.converter.parse_arg(argname_fmt % i, i + 1, displayname) if parsearg is None: #print('Cannot convert %s %r for %s' % (p.converter.__class__.__name__, p.converter.format_unit, p.converter.name), file=sys.stderr) parser_code = None @@ -2267,6 +2268,12 @@ def __init__(self, name, kind, *, default=_empty, def __repr__(self): return '' + def is_positional_or_keyword(self): + return self.kind in ( + inspect.Parameter.POSITIONAL_OR_KEYWORD, + inspect.Parameter.KEYWORD_ONLY + ) + def is_keyword_only(self): return self.kind == inspect.Parameter.KEYWORD_ONLY @@ -2289,6 +2296,11 @@ def copy(self, **overrides): kwargs['converter'] = converter return Parameter(**kwargs) + def displayname(self): + if self.is_positional_or_keyword(): + return f'"{self.name}"' + else: + return 'NULL' class LandMine: @@ -2636,7 +2648,7 @@ def pre_render(self): """ pass - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'O&': return """ if (!{converter}({argname}, &{paramname})) {{{{ @@ -2650,21 +2662,22 @@ def parse_arg(self, argname, argnum): typecheck, typename = type_checks[self.subclass_of] return """ if (!{typecheck}({argname})) {{{{ - _PyArg_BadArgument("{{name}}", "{argnum}", "{typename}", {argname}); + _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "{typename}", {argname}); goto exit; }}}} {paramname} = {cast}{argname}; """.format(argname=argname, paramname=self.name, - argnum=argnum, + argnum=argnum, displayname=displayname, typecheck=typecheck, typename=typename, cast=cast) return """ if (!PyObject_TypeCheck({argname}, {subclass_of})) {{{{ - _PyArg_BadArgument("{{name}}", "{argnum}", ({subclass_of})->tp_name, {argname}); + _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, ({subclass_of})->tp_name, {argname}); goto exit; }}}} {paramname} = {cast}{argname}; """.format(argname=argname, paramname=self.name, argnum=argnum, - subclass_of=self.subclass_of, cast=cast) + subclass_of=self.subclass_of, cast=cast, + displayname=displayname) if self.format_unit == 'O': cast = '(%s)' % self.type if self.type != 'PyObject *' else '' return """ @@ -2700,7 +2713,7 @@ def converter_init(self, *, accept={object}): self.default = bool(self.default) self.c_default = str(int(self.default)) - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'i': # XXX PyFloat_Check can be removed after the end of the # deprecation in _PyLong_FromNbIndexOrNbInt. @@ -2722,7 +2735,7 @@ def parse_arg(self, argname, argnum): goto exit; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum) + return super().parse_arg(argname, argnum, displayname) class char_converter(CConverter): type = 'char' @@ -2739,7 +2752,7 @@ def converter_init(self): if self.c_default == '"\'"': self.c_default = r"'\''" - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'c': return """ if (PyBytes_Check({argname}) && PyBytes_GET_SIZE({argname}) == 1) {{{{ @@ -2749,11 +2762,12 @@ def parse_arg(self, argname, argnum): {paramname} = PyByteArray_AS_STRING({argname})[0]; }}}} else {{{{ - _PyArg_BadArgument("{{name}}", "{argnum}", "a byte string of length 1", {argname}); + _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "a byte string of length 1", {argname}); goto exit; }}}} - """.format(argname=argname, paramname=self.name, argnum=argnum) - return super().parse_arg(argname, argnum) + """.format(argname=argname, paramname=self.name, argnum=argnum, + displayname=displayname) + return super().parse_arg(argname, argnum, displayname) @add_legacy_c_converter('B', bitwise=True) @@ -2767,7 +2781,7 @@ def converter_init(self, *, bitwise=False): if bitwise: self.format_unit = 'B' - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'b': return """ if (PyFloat_Check({argname})) {{{{ @@ -2812,7 +2826,7 @@ def parse_arg(self, argname, argnum): }}}} }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum) + return super().parse_arg(argname, argnum, displayname) class byte_converter(unsigned_char_converter): pass @@ -2822,7 +2836,7 @@ class short_converter(CConverter): format_unit = 'h' c_ignored_default = "0" - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'h': return """ if (PyFloat_Check({argname})) {{{{ @@ -2850,7 +2864,7 @@ def parse_arg(self, argname, argnum): }}}} }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum) + return super().parse_arg(argname, argnum, displayname) class unsigned_short_converter(CConverter): type = 'unsigned short' @@ -2863,7 +2877,7 @@ def converter_init(self, *, bitwise=False): else: self.converter = '_PyLong_UnsignedShort_Converter' - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'H': return """ if (PyFloat_Check({argname})) {{{{ @@ -2876,7 +2890,7 @@ def parse_arg(self, argname, argnum): goto exit; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum) + return super().parse_arg(argname, argnum, displayname) @add_legacy_c_converter('C', accept={str}) class int_converter(CConverter): @@ -2893,7 +2907,7 @@ def converter_init(self, *, accept={int}, type=None): if type != None: self.type = type - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'i': return """ if (PyFloat_Check({argname})) {{{{ @@ -2909,19 +2923,20 @@ def parse_arg(self, argname, argnum): elif self.format_unit == 'C': return """ if (!PyUnicode_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", "{argnum}", "a unicode character", {argname}); + _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "a unicode character", {argname}); goto exit; }}}} if (PyUnicode_READY({argname})) {{{{ goto exit; }}}} if (PyUnicode_GET_LENGTH({argname}) != 1) {{{{ - _PyArg_BadArgument("{{name}}", "{argnum}", "a unicode character", {argname}); + _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "a unicode character", {argname}); goto exit; }}}} {paramname} = PyUnicode_READ_CHAR({argname}, 0); - """.format(argname=argname, paramname=self.name, argnum=argnum) - return super().parse_arg(argname, argnum) + """.format(argname=argname, paramname=self.name, argnum=argnum, + displayname=displayname) + return super().parse_arg(argname, argnum, displayname) class unsigned_int_converter(CConverter): type = 'unsigned int' @@ -2934,7 +2949,7 @@ def converter_init(self, *, bitwise=False): else: self.converter = '_PyLong_UnsignedInt_Converter' - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'I': return """ if (PyFloat_Check({argname})) {{{{ @@ -2947,7 +2962,7 @@ def parse_arg(self, argname, argnum): goto exit; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum) + return super().parse_arg(argname, argnum, displayname) class long_converter(CConverter): type = 'long' @@ -2955,7 +2970,7 @@ class long_converter(CConverter): format_unit = 'l' c_ignored_default = "0" - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'l': return """ if (PyFloat_Check({argname})) {{{{ @@ -2968,7 +2983,7 @@ def parse_arg(self, argname, argnum): goto exit; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum) + return super().parse_arg(argname, argnum, displayname) class unsigned_long_converter(CConverter): type = 'unsigned long' @@ -2981,16 +2996,17 @@ def converter_init(self, *, bitwise=False): else: self.converter = '_PyLong_UnsignedLong_Converter' - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'k': return """ if (!PyLong_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", "{argnum}", "int", {argname}); + _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "int", {argname}); goto exit; }}}} {paramname} = PyLong_AsUnsignedLongMask({argname}); - """.format(argname=argname, paramname=self.name, argnum=argnum) - return super().parse_arg(argname, argnum) + """.format(argname=argname, paramname=self.name, argnum=argnum, + displayname=displayname) + return super().parse_arg(argname, argnum, displayname) class long_long_converter(CConverter): type = 'long long' @@ -2998,7 +3014,7 @@ class long_long_converter(CConverter): format_unit = 'L' c_ignored_default = "0" - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'L': return """ if (PyFloat_Check({argname})) {{{{ @@ -3011,7 +3027,7 @@ def parse_arg(self, argname, argnum): goto exit; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum) + return super().parse_arg(argname, argnum, displayname) class unsigned_long_long_converter(CConverter): type = 'unsigned long long' @@ -3024,16 +3040,17 @@ def converter_init(self, *, bitwise=False): else: self.converter = '_PyLong_UnsignedLongLong_Converter' - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'K': return """ if (!PyLong_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", "{argnum}", "int", {argname}); + _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "int", {argname}); goto exit; }}}} {paramname} = PyLong_AsUnsignedLongLongMask({argname}); - """.format(argname=argname, paramname=self.name, argnum=argnum) - return super().parse_arg(argname, argnum) + """.format(argname=argname, paramname=self.name, argnum=argnum, + displayname=displayname) + return super().parse_arg(argname, argnum, displayname) class Py_ssize_t_converter(CConverter): type = 'Py_ssize_t' @@ -3048,7 +3065,7 @@ def converter_init(self, *, accept={int}): else: fail("Py_ssize_t_converter: illegal 'accept' argument " + repr(accept)) - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'n': return """ if (PyFloat_Check({argname})) {{{{ @@ -3069,7 +3086,7 @@ def parse_arg(self, argname, argnum): {paramname} = ival; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum) + return super().parse_arg(argname, argnum, displayname) class slice_index_converter(CConverter): @@ -3088,7 +3105,7 @@ class size_t_converter(CConverter): converter = '_PyLong_Size_t_Converter' c_ignored_default = "0" - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'n': return """ {paramname} = PyNumber_AsSsize_t({argname}, PyExc_OverflowError); @@ -3096,7 +3113,7 @@ def parse_arg(self, argname, argnum): goto exit; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum) + return super().parse_arg(argname, argnum, displayname) class float_converter(CConverter): @@ -3105,7 +3122,7 @@ class float_converter(CConverter): format_unit = 'f' c_ignored_default = "0.0" - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'f': return """ {paramname} = (float) PyFloat_AsDouble({argname}); @@ -3113,7 +3130,7 @@ def parse_arg(self, argname, argnum): goto exit; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum) + return super().parse_arg(argname, argnum, displayname) class double_converter(CConverter): type = 'double' @@ -3121,7 +3138,7 @@ class double_converter(CConverter): format_unit = 'd' c_ignored_default = "0.0" - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'd': return """ {paramname} = PyFloat_AsDouble({argname}); @@ -3129,7 +3146,7 @@ def parse_arg(self, argname, argnum): goto exit; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum) + return super().parse_arg(argname, argnum, displayname) class Py_complex_converter(CConverter): @@ -3138,7 +3155,7 @@ class Py_complex_converter(CConverter): format_unit = 'D' c_ignored_default = "{0.0, 0.0}" - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'D': return """ {paramname} = PyComplex_AsCComplex({argname}); @@ -3146,7 +3163,7 @@ def parse_arg(self, argname, argnum): goto exit; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum) + return super().parse_arg(argname, argnum, displayname) class object_converter(CConverter): @@ -3212,11 +3229,11 @@ def cleanup(self): name = self.name return "".join(["if (", name, ") {\n PyMem_FREE(", name, ");\n}\n"]) - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 's': return """ if (!PyUnicode_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", "{argnum}", "str", {argname}); + _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "str", {argname}); goto exit; }}}} Py_ssize_t {paramname}_length; @@ -3228,7 +3245,8 @@ def parse_arg(self, argname, argnum): PyErr_SetString(PyExc_ValueError, "embedded null character"); goto exit; }}}} - """.format(argname=argname, paramname=self.name, argnum=argnum) + """.format(argname=argname, paramname=self.name, argnum=argnum, + displayname=displayname) if self.format_unit == 'z': return """ if ({argname} == Py_None) {{{{ @@ -3246,11 +3264,12 @@ def parse_arg(self, argname, argnum): }}}} }}}} else {{{{ - _PyArg_BadArgument("{{name}}", "{argnum}", "str or None", {argname}); + _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "str or None", {argname}); goto exit; }}}} - """.format(argname=argname, paramname=self.name, argnum=argnum) - return super().parse_arg(argname, argnum) + """.format(argname=argname, paramname=self.name, argnum=argnum, + displayname=displayname) + return super().parse_arg(argname, argnum, displayname) # # This is the fourth or fifth rewrite of registering all the @@ -3305,53 +3324,54 @@ class PyBytesObject_converter(CConverter): format_unit = 'S' # accept = {bytes} - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'S': return """ if (!PyBytes_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", "{argnum}", "bytes", {argname}); + _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "bytes", {argname}); goto exit; }}}} {paramname} = ({type}){argname}; """.format(argname=argname, paramname=self.name, argnum=argnum, - type=self.type) - return super().parse_arg(argname, argnum) + type=self.type, displayname=displayname) + return super().parse_arg(argname, argnum, displayname) class PyByteArrayObject_converter(CConverter): type = 'PyByteArrayObject *' format_unit = 'Y' # accept = {bytearray} - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'Y': return """ if (!PyByteArray_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", "{argnum}", "bytearray", {argname}); + _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "bytearray", {argname}); goto exit; }}}} {paramname} = ({type}){argname}; """.format(argname=argname, paramname=self.name, argnum=argnum, type=self.type) - return super().parse_arg(argname, argnum) + return super().parse_arg(argname, argnum, displayname) class unicode_converter(CConverter): type = 'PyObject *' default_type = (str, Null, NoneType) format_unit = 'U' - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'U': return """ if (!PyUnicode_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", "{argnum}", "str", {argname}); + _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "str", {argname}); goto exit; }}}} if (PyUnicode_READY({argname}) == -1) {{{{ goto exit; }}}} {paramname} = {argname}; - """.format(argname=argname, paramname=self.name, argnum=argnum) - return super().parse_arg(argname, argnum) + """.format(argname=argname, paramname=self.name, argnum=argnum, + displayname=displayname) + return super().parse_arg(argname, argnum, displayname) @add_legacy_c_converter('u#', zeroes=True) @add_legacy_c_converter('Z', accept={str, NoneType}) @@ -3400,17 +3420,18 @@ def cleanup(self): name = self.name return "".join(["if (", name, ".obj) {\n PyBuffer_Release(&", name, ");\n}\n"]) - def parse_arg(self, argname, argnum): + def parse_arg(self, argname, argnum, displayname): if self.format_unit == 'y*': return """ if (PyObject_GetBuffer({argname}, &{paramname}, PyBUF_SIMPLE) != 0) {{{{ goto exit; }}}} if (!PyBuffer_IsContiguous(&{paramname}, 'C')) {{{{ - _PyArg_BadArgument("{{name}}", "{argnum}", "contiguous buffer", {argname}); + _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "contiguous buffer", {argname}); goto exit; }}}} - """.format(argname=argname, paramname=self.name, argnum=argnum) + """.format(argname=argname, paramname=self.name, argnum=argnum, + displayname=displayname) elif self.format_unit == 's*': return """ if (PyUnicode_Check({argname})) {{{{ @@ -3426,24 +3447,26 @@ def parse_arg(self, argname, argnum): goto exit; }}}} if (!PyBuffer_IsContiguous(&{paramname}, 'C')) {{{{ - _PyArg_BadArgument("{{name}}", "{argnum}", "contiguous buffer", {argname}); + _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "contiguous buffer", {argname}); goto exit; }}}} }}}} - """.format(argname=argname, paramname=self.name, argnum=argnum) + """.format(argname=argname, paramname=self.name, argnum=argnum, + displayname=displayname) elif self.format_unit == 'w*': return """ if (PyObject_GetBuffer({argname}, &{paramname}, PyBUF_WRITABLE) < 0) {{{{ PyErr_Clear(); - _PyArg_BadArgument("{{name}}", "{argnum}", "read-write bytes-like object", {argname}); + _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "read-write bytes-like object", {argname}); goto exit; }}}} if (!PyBuffer_IsContiguous(&{paramname}, 'C')) {{{{ - _PyArg_BadArgument("{{name}}", "{argnum}", "contiguous buffer", {argname}); + _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "contiguous buffer", {argname}); goto exit; }}}} - """.format(argname=argname, paramname=self.name, argnum=argnum) - return super().parse_arg(argname, argnum) + """.format(argname=argname, paramname=self.name, argnum=argnum, + displayname=displayname) + return super().parse_arg(argname, argnum, displayname) def correct_name_for_self(f): From 81ad951bb681cb83d1c6cd1c76a0a34f93d9abbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Lapeyre?= Date: Wed, 29 May 2019 14:54:42 +0200 Subject: [PATCH 06/15] Run make clinic --- Lib/test/clinic.test | 108 ++++++----- Modules/_blake2/clinic/blake2b_impl.c.h | 8 +- Modules/_blake2/clinic/blake2s_impl.c.h | 8 +- Modules/_io/clinic/_iomodule.c.h | 12 +- Modules/_io/clinic/bufferedio.c.h | 20 +-- Modules/_io/clinic/bytesio.c.h | 6 +- Modules/_io/clinic/fileio.c.h | 10 +- Modules/_io/clinic/textio.c.h | 8 +- Modules/_io/clinic/winconsoleio.c.h | 10 +- .../_multiprocessing/clinic/posixshmem.c.h | 6 +- Modules/cjkcodecs/clinic/multibytecodec.c.h | 14 +- Modules/clinic/_bz2module.c.h | 6 +- Modules/clinic/_codecsmodule.c.h | 168 +++++++++--------- Modules/clinic/_cryptmodule.c.h | 6 +- Modules/clinic/_curses_panel.c.h | 6 +- Modules/clinic/_cursesmodule.c.h | 14 +- Modules/clinic/_dbmmodule.c.h | 6 +- Modules/clinic/_elementtree.c.h | 12 +- Modules/clinic/_gdbmmodule.c.h | 6 +- Modules/clinic/_hashopenssl.c.h | 24 +-- Modules/clinic/_lzmamodule.c.h | 8 +- Modules/clinic/_pickle.c.h | 14 +- Modules/clinic/_sre.c.h | 8 +- Modules/clinic/_ssl.c.h | 28 +-- Modules/clinic/_struct.c.h | 10 +- Modules/clinic/_tkinter.c.h | 30 ++-- Modules/clinic/_weakref.c.h | 4 +- Modules/clinic/arraymodule.c.h | 10 +- Modules/clinic/audioop.c.h | 60 +++---- Modules/clinic/binascii.c.h | 22 +-- Modules/clinic/grpmodule.c.h | 4 +- Modules/clinic/itertoolsmodule.c.h | 6 +- Modules/clinic/mathmodule.c.h | 6 +- Modules/clinic/posixmodule.c.h | 16 +- Modules/clinic/pwdmodule.c.h | 4 +- Modules/clinic/pyexpat.c.h | 12 +- Modules/clinic/signalmodule.c.h | 4 +- Modules/clinic/spwdmodule.c.h | 4 +- Modules/clinic/symtablemodule.c.h | 4 +- Modules/clinic/unicodedata.c.h | 50 +++--- Modules/clinic/zlibmodule.c.h | 16 +- Objects/clinic/bytearrayobject.c.h | 16 +- Objects/clinic/bytesobject.c.h | 20 +-- Objects/clinic/codeobject.c.h | 20 +-- Objects/clinic/floatobject.c.h | 10 +- Objects/clinic/funcobject.c.h | 6 +- Objects/clinic/longobject.c.h | 8 +- Objects/clinic/moduleobject.c.h | 4 +- Objects/clinic/typeobject.c.h | 4 +- Objects/clinic/unicodeobject.c.h | 16 +- Objects/stringlib/clinic/transmogrify.h.h | 8 +- PC/clinic/_testconsole.c.h | 4 +- PC/clinic/msvcrtmodule.c.h | 14 +- Python/clinic/bltinmodule.c.h | 6 +- Python/clinic/import.c.h | 18 +- Python/clinic/marshal.c.h | 4 +- Python/clinic/sysmodule.c.h | 6 +- Python/clinic/traceback.c.h | 4 +- Tools/clinic/clinic.py | 4 +- 59 files changed, 474 insertions(+), 476 deletions(-) diff --git a/Lib/test/clinic.test b/Lib/test/clinic.test index 08462236478bff..a9e1d7ada19224 100644 --- a/Lib/test/clinic.test +++ b/Lib/test/clinic.test @@ -44,7 +44,7 @@ test_object_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("test_object_converter", "3", "str", args[2]); + _PyArg_BadArgument("test_object_converter", 3, NULL, "str", args[2]); goto exit; } c = args[2]; @@ -58,7 +58,7 @@ exit: static PyObject * test_object_converter_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c, PyUnicode_Object *d) -/*[clinic end generated code: output=330a33c7fa1cb1d2 input=005e6a8a711a869b]*/ +/*[clinic end generated code: output=2de0f1e8f6ee45a3 input=005e6a8a711a869b]*/ /*[clinic input] @@ -180,52 +180,52 @@ test_object_converter_subclass_of(PyObject *module, PyObject *const *args, Py_ss goto exit; } if (!PyLong_Check(args[0])) { - _PyArg_BadArgument("test_object_converter_subclass_of", "1", "int", args[0]); + _PyArg_BadArgument("test_object_converter_subclass_of", 1, NULL, "int", args[0]); goto exit; } a = args[0]; if (!PyTuple_Check(args[1])) { - _PyArg_BadArgument("test_object_converter_subclass_of", "2", "tuple", args[1]); + _PyArg_BadArgument("test_object_converter_subclass_of", 2, NULL, "tuple", args[1]); goto exit; } b = args[1]; if (!PyList_Check(args[2])) { - _PyArg_BadArgument("test_object_converter_subclass_of", "3", "list", args[2]); + _PyArg_BadArgument("test_object_converter_subclass_of", 3, NULL, "list", args[2]); goto exit; } c = args[2]; if (!PySet_Check(args[3])) { - _PyArg_BadArgument("test_object_converter_subclass_of", "4", "set", args[3]); + _PyArg_BadArgument("test_object_converter_subclass_of", 4, NULL, "set", args[3]); goto exit; } d = args[3]; if (!PyFrozenSet_Check(args[4])) { - _PyArg_BadArgument("test_object_converter_subclass_of", "5", "frozenset", args[4]); + _PyArg_BadArgument("test_object_converter_subclass_of", 5, NULL, "frozenset", args[4]); goto exit; } e = args[4]; if (!PyDict_Check(args[5])) { - _PyArg_BadArgument("test_object_converter_subclass_of", "6", "dict", args[5]); + _PyArg_BadArgument("test_object_converter_subclass_of", 6, NULL, "dict", args[5]); goto exit; } f = args[5]; if (!PyUnicode_Check(args[6])) { - _PyArg_BadArgument("test_object_converter_subclass_of", "7", "str", args[6]); + _PyArg_BadArgument("test_object_converter_subclass_of", 7, NULL, "str", args[6]); goto exit; } g = args[6]; if (!PyBytes_Check(args[7])) { - _PyArg_BadArgument("test_object_converter_subclass_of", "8", "bytes", args[7]); + _PyArg_BadArgument("test_object_converter_subclass_of", 8, NULL, "bytes", args[7]); goto exit; } h = args[7]; if (!PyByteArray_Check(args[8])) { - _PyArg_BadArgument("test_object_converter_subclass_of", "9", "bytearray", args[8]); + _PyArg_BadArgument("test_object_converter_subclass_of", 9, NULL, "bytearray", args[8]); goto exit; } i = args[8]; if (!PyObject_TypeCheck(args[9], &MyType)) { - _PyArg_BadArgument("test_object_converter_subclass_of", "10", (&MyType)->tp_name, args[9]); + _PyArg_BadArgument("test_object_converter_subclass_of", 10, NULL, (&MyType)->tp_name, args[9]); goto exit; } j = args[9]; @@ -240,7 +240,7 @@ test_object_converter_subclass_of_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c, PyObject *d, PyObject *e, PyObject *f, PyObject *g, PyObject *h, PyObject *i, PyObject *j) -/*[clinic end generated code: output=b78cace6b03450c5 input=31b06b772d5f983e]*/ +/*[clinic end generated code: output=823cd4fbe76c3298 input=31b06b772d5f983e]*/ /*[clinic input] @@ -269,7 +269,7 @@ test_PyBytesObject_converter(PyObject *module, PyObject *arg) PyBytesObject *a; if (!PyBytes_Check(arg)) { - _PyArg_BadArgument("test_PyBytesObject_converter", "0", "bytes", arg); + _PyArg_BadArgument("test_PyBytesObject_converter", 0, NULL, "bytes", arg); goto exit; } a = (PyBytesObject *)arg; @@ -281,7 +281,7 @@ exit: static PyObject * test_PyBytesObject_converter_impl(PyObject *module, PyBytesObject *a) -/*[clinic end generated code: output=19f9031800e64238 input=12b10c7cb5750400]*/ +/*[clinic end generated code: output=b96ac2ef4d3b6027 input=12b10c7cb5750400]*/ /*[clinic input] @@ -310,7 +310,7 @@ test_PyByteArrayObject_converter(PyObject *module, PyObject *arg) PyByteArrayObject *a; if (!PyByteArray_Check(arg)) { - _PyArg_BadArgument("test_PyByteArrayObject_converter", "0", "bytearray", arg); + _PyArg_BadArgument("test_PyByteArrayObject_converter", 0, NULL, "bytearray", arg); goto exit; } a = (PyByteArrayObject *)arg; @@ -322,7 +322,7 @@ exit: static PyObject * test_PyByteArrayObject_converter_impl(PyObject *module, PyByteArrayObject *a) -/*[clinic end generated code: output=1b4c1a61d2f16b59 input=5a657da535d194ae]*/ +/*[clinic end generated code: output=61699c6a617e80f8 input=5a657da535d194ae]*/ /*[clinic input] @@ -351,7 +351,7 @@ test_unicode_converter(PyObject *module, PyObject *arg) PyObject *a; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("test_unicode_converter", "0", "str", arg); + _PyArg_BadArgument("test_unicode_converter", 0, NULL, "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -366,7 +366,7 @@ exit: static PyObject * test_unicode_converter_impl(PyObject *module, PyObject *a) -/*[clinic end generated code: output=42cfac01ad013002 input=aa33612df92aa9c5]*/ +/*[clinic end generated code: output=da4a52a3672efb43 input=aa33612df92aa9c5]*/ /*[clinic input] @@ -507,7 +507,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) a = PyByteArray_AS_STRING(args[0])[0]; } else { - _PyArg_BadArgument("test_char_converter", "1", "a byte string of length 1", args[0]); + _PyArg_BadArgument("test_char_converter", 1, NULL, "a byte string of length 1", args[0]); goto exit; } if (nargs < 2) { @@ -520,7 +520,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) b = PyByteArray_AS_STRING(args[1])[0]; } else { - _PyArg_BadArgument("test_char_converter", "2", "a byte string of length 1", args[1]); + _PyArg_BadArgument("test_char_converter", 2, NULL, "a byte string of length 1", args[1]); goto exit; } if (nargs < 3) { @@ -533,7 +533,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) c = PyByteArray_AS_STRING(args[2])[0]; } else { - _PyArg_BadArgument("test_char_converter", "3", "a byte string of length 1", args[2]); + _PyArg_BadArgument("test_char_converter", 3, NULL, "a byte string of length 1", args[2]); goto exit; } if (nargs < 4) { @@ -546,7 +546,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) d = PyByteArray_AS_STRING(args[3])[0]; } else { - _PyArg_BadArgument("test_char_converter", "4", "a byte string of length 1", args[3]); + _PyArg_BadArgument("test_char_converter", 4, NULL, "a byte string of length 1", args[3]); goto exit; } if (nargs < 5) { @@ -559,7 +559,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) e = PyByteArray_AS_STRING(args[4])[0]; } else { - _PyArg_BadArgument("test_char_converter", "5", "a byte string of length 1", args[4]); + _PyArg_BadArgument("test_char_converter", 5, NULL, "a byte string of length 1", args[4]); goto exit; } if (nargs < 6) { @@ -572,7 +572,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) f = PyByteArray_AS_STRING(args[5])[0]; } else { - _PyArg_BadArgument("test_char_converter", "6", "a byte string of length 1", args[5]); + _PyArg_BadArgument("test_char_converter", 6, NULL, "a byte string of length 1", args[5]); goto exit; } if (nargs < 7) { @@ -585,7 +585,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) g = PyByteArray_AS_STRING(args[6])[0]; } else { - _PyArg_BadArgument("test_char_converter", "7", "a byte string of length 1", args[6]); + _PyArg_BadArgument("test_char_converter", 7, NULL, "a byte string of length 1", args[6]); goto exit; } if (nargs < 8) { @@ -598,7 +598,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) h = PyByteArray_AS_STRING(args[7])[0]; } else { - _PyArg_BadArgument("test_char_converter", "8", "a byte string of length 1", args[7]); + _PyArg_BadArgument("test_char_converter", 8, NULL, "a byte string of length 1", args[7]); goto exit; } if (nargs < 9) { @@ -611,7 +611,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) i = PyByteArray_AS_STRING(args[8])[0]; } else { - _PyArg_BadArgument("test_char_converter", "9", "a byte string of length 1", args[8]); + _PyArg_BadArgument("test_char_converter", 9, NULL, "a byte string of length 1", args[8]); goto exit; } if (nargs < 10) { @@ -624,7 +624,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) j = PyByteArray_AS_STRING(args[9])[0]; } else { - _PyArg_BadArgument("test_char_converter", "10", "a byte string of length 1", args[9]); + _PyArg_BadArgument("test_char_converter", 10, NULL, "a byte string of length 1", args[9]); goto exit; } if (nargs < 11) { @@ -637,7 +637,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) k = PyByteArray_AS_STRING(args[10])[0]; } else { - _PyArg_BadArgument("test_char_converter", "11", "a byte string of length 1", args[10]); + _PyArg_BadArgument("test_char_converter", 11, NULL, "a byte string of length 1", args[10]); goto exit; } if (nargs < 12) { @@ -650,7 +650,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) l = PyByteArray_AS_STRING(args[11])[0]; } else { - _PyArg_BadArgument("test_char_converter", "12", "a byte string of length 1", args[11]); + _PyArg_BadArgument("test_char_converter", 12, NULL, "a byte string of length 1", args[11]); goto exit; } if (nargs < 13) { @@ -663,7 +663,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) m = PyByteArray_AS_STRING(args[12])[0]; } else { - _PyArg_BadArgument("test_char_converter", "13", "a byte string of length 1", args[12]); + _PyArg_BadArgument("test_char_converter", 13, NULL, "a byte string of length 1", args[12]); goto exit; } if (nargs < 14) { @@ -676,7 +676,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) n = PyByteArray_AS_STRING(args[13])[0]; } else { - _PyArg_BadArgument("test_char_converter", "14", "a byte string of length 1", args[13]); + _PyArg_BadArgument("test_char_converter", 14, NULL, "a byte string of length 1", args[13]); goto exit; } skip_optional: @@ -690,7 +690,7 @@ static PyObject * test_char_converter_impl(PyObject *module, char a, char b, char c, char d, char e, char f, char g, char h, char i, char j, char k, char l, char m, char n) -/*[clinic end generated code: output=a2beab3f9300b7b1 input=e42330417a44feac]*/ +/*[clinic end generated code: output=911fd6b0a8707d54 input=e42330417a44feac]*/ /*[clinic input] @@ -1009,14 +1009,14 @@ test_int_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("test_int_converter", "3", "a unicode character", args[2]); + _PyArg_BadArgument("test_int_converter", 3, NULL, "a unicode character", args[2]); goto exit; } if (PyUnicode_READY(args[2])) { goto exit; } if (PyUnicode_GET_LENGTH(args[2]) != 1) { - _PyArg_BadArgument("test_int_converter", "3", "a unicode character", args[2]); + _PyArg_BadArgument("test_int_converter", 3, NULL, "a unicode character", args[2]); goto exit; } c = PyUnicode_READ_CHAR(args[2], 0); @@ -1041,7 +1041,7 @@ exit: static PyObject * test_int_converter_impl(PyObject *module, int a, int b, int c, myenum d) -/*[clinic end generated code: output=05acde55329aed6b input=d20541fc1ca0553e]*/ +/*[clinic end generated code: output=dea1562ef1ad1efb input=d20541fc1ca0553e]*/ /*[clinic input] @@ -1215,7 +1215,7 @@ test_unsigned_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t goto skip_optional; } if (!PyLong_Check(args[2])) { - _PyArg_BadArgument("test_unsigned_long_converter", "3", "int", args[2]); + _PyArg_BadArgument("test_unsigned_long_converter", 3, NULL, "int", args[2]); goto exit; } c = PyLong_AsUnsignedLongMask(args[2]); @@ -1229,7 +1229,7 @@ exit: static PyObject * test_unsigned_long_converter_impl(PyObject *module, unsigned long a, unsigned long b, unsigned long c) -/*[clinic end generated code: output=96283dbd617a0e9e input=f450d94cae1ef73b]*/ +/*[clinic end generated code: output=d70fa21188eb8a19 input=f450d94cae1ef73b]*/ /*[clinic input] @@ -1335,7 +1335,7 @@ test_unsigned_long_long_converter(PyObject *module, PyObject *const *args, Py_ss goto skip_optional; } if (!PyLong_Check(args[2])) { - _PyArg_BadArgument("test_unsigned_long_long_converter", "3", "int", args[2]); + _PyArg_BadArgument("test_unsigned_long_long_converter", 3, NULL, "int", args[2]); goto exit; } c = PyLong_AsUnsignedLongLongMask(args[2]); @@ -1351,7 +1351,7 @@ test_unsigned_long_long_converter_impl(PyObject *module, unsigned long long a, unsigned long long b, unsigned long long c) -/*[clinic end generated code: output=21859dd0bd80862a input=a15115dc41866ff4]*/ +/*[clinic end generated code: output=7949607b82837b4b input=a15115dc41866ff4]*/ /*[clinic input] @@ -3197,7 +3197,7 @@ test_posonly_opt_keywords_opt_kwonly_opt_impl(PyObject *module, PyObject *a, /*[clinic end generated code: output=719e4f6c224402d4 input=9914857713c5bbf8]*/ /*[clinic input] -test_posonly_opt_keywords_opt_kwonly_opt +test_keyword_only_parameter * @@ -3205,24 +3205,23 @@ test_posonly_opt_keywords_opt_kwonly_opt [clinic start generated code]*/ -PyDoc_STRVAR(test_posonly_opt_keywords_opt_kwonly_opt__doc__, -"test_posonly_opt_keywords_opt_kwonly_opt($module, /, *, co_lnotab=None)\n" +PyDoc_STRVAR(test_keyword_only_parameter__doc__, +"test_keyword_only_parameter($module, /, *, co_lnotab=None)\n" "--\n" "\n"); -#define TEST_POSONLY_OPT_KEYWORDS_OPT_KWONLY_OPT_METHODDEF \ - {"test_posonly_opt_keywords_opt_kwonly_opt", (PyCFunction)(void(*)(void))test_posonly_opt_keywords_opt_kwonly_opt, METH_FASTCALL|METH_KEYWORDS, test_posonly_opt_keywords_opt_kwonly_opt__doc__}, +#define TEST_KEYWORD_ONLY_PARAMETER_METHODDEF \ + {"test_keyword_only_parameter", (PyCFunction)(void(*)(void))test_keyword_only_parameter, METH_FASTCALL|METH_KEYWORDS, test_keyword_only_parameter__doc__}, static PyObject * -test_posonly_opt_keywords_opt_kwonly_opt_impl(PyObject *module, - PyBytesObject *co_lnotab); +test_keyword_only_parameter_impl(PyObject *module, PyBytesObject *co_lnotab); static PyObject * -test_posonly_opt_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) +test_keyword_only_parameter(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; static const char * const _keywords[] = {"co_lnotab", NULL}; - static _PyArg_Parser _parser = {NULL, _keywords, "test_posonly_opt_keywords_opt_kwonly_opt", 0}; + static _PyArg_Parser _parser = {NULL, _keywords, "test_keyword_only_parameter", 0}; PyObject *argsbuf[1]; Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0; PyBytesObject *co_lnotab = (PyBytesObject *)self->co_lnotab; @@ -3235,18 +3234,17 @@ test_posonly_opt_keywords_opt_kwonly_opt(PyObject *module, PyObject *const *args goto skip_optional_kwonly; } if (!PyBytes_Check(args[0])) { - _PyArg_BadArgument("test_posonly_opt_keywords_opt_kwonly_opt", "'co_lnotab'", "bytes", args[0]); + _PyArg_BadArgument("test_keyword_only_parameter", 1, "co_lnotab", "bytes", args[0]); goto exit; } co_lnotab = (PyBytesObject *)args[0]; skip_optional_kwonly: - return_value = test_posonly_opt_keywords_opt_kwonly_opt_impl(module, co_lnotab); + return_value = test_keyword_only_parameter_impl(module, co_lnotab); exit: return return_value; } static PyObject * -test_posonly_opt_keywords_opt_kwonly_opt_impl(PyObject *module, - PyBytesObject *co_lnotab) -/*[clinic end generated code: output=f898e97c2ddd2f0e input=e7b42af17f2a55ec]*/ +test_keyword_only_parameter_impl(PyObject *module, PyBytesObject *co_lnotab) +/*[clinic end generated code: output=b44208ba80c05287 input=303df5046c7e37a3]*/ diff --git a/Modules/_blake2/clinic/blake2b_impl.c.h b/Modules/_blake2/clinic/blake2b_impl.c.h index ec67d885811b74..f820006e58b768 100644 --- a/Modules/_blake2/clinic/blake2b_impl.c.h +++ b/Modules/_blake2/clinic/blake2b_impl.c.h @@ -72,7 +72,7 @@ py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&key, 'C')) { - _PyArg_BadArgument("blake2b", "'key'", "contiguous buffer", fastargs[2]); + _PyArg_BadArgument("blake2b", 3, "key", "contiguous buffer", fastargs[2]); goto exit; } if (!--noptargs) { @@ -84,7 +84,7 @@ py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&salt, 'C')) { - _PyArg_BadArgument("blake2b", "'salt'", "contiguous buffer", fastargs[3]); + _PyArg_BadArgument("blake2b", 4, "salt", "contiguous buffer", fastargs[3]); goto exit; } if (!--noptargs) { @@ -96,7 +96,7 @@ py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&person, 'C')) { - _PyArg_BadArgument("blake2b", "'person'", "contiguous buffer", fastargs[4]); + _PyArg_BadArgument("blake2b", 5, "person", "contiguous buffer", fastargs[4]); goto exit; } if (!--noptargs) { @@ -261,4 +261,4 @@ _blake2_blake2b_hexdigest(BLAKE2bObject *self, PyObject *Py_UNUSED(ignored)) { return _blake2_blake2b_hexdigest_impl(self); } -/*[clinic end generated code: output=b029b6e555794580 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dda27ce5a2bfc110 input=a9049054013a1b77]*/ diff --git a/Modules/_blake2/clinic/blake2s_impl.c.h b/Modules/_blake2/clinic/blake2s_impl.c.h index acdf91cd78029d..90cb848b07625a 100644 --- a/Modules/_blake2/clinic/blake2s_impl.c.h +++ b/Modules/_blake2/clinic/blake2s_impl.c.h @@ -72,7 +72,7 @@ py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&key, 'C')) { - _PyArg_BadArgument("blake2s", "'key'", "contiguous buffer", fastargs[2]); + _PyArg_BadArgument("blake2s", 3, "key", "contiguous buffer", fastargs[2]); goto exit; } if (!--noptargs) { @@ -84,7 +84,7 @@ py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&salt, 'C')) { - _PyArg_BadArgument("blake2s", "'salt'", "contiguous buffer", fastargs[3]); + _PyArg_BadArgument("blake2s", 4, "salt", "contiguous buffer", fastargs[3]); goto exit; } if (!--noptargs) { @@ -96,7 +96,7 @@ py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&person, 'C')) { - _PyArg_BadArgument("blake2s", "'person'", "contiguous buffer", fastargs[4]); + _PyArg_BadArgument("blake2s", 5, "person", "contiguous buffer", fastargs[4]); goto exit; } if (!--noptargs) { @@ -261,4 +261,4 @@ _blake2_blake2s_hexdigest(BLAKE2sObject *self, PyObject *Py_UNUSED(ignored)) { return _blake2_blake2s_hexdigest_impl(self); } -/*[clinic end generated code: output=62da9834353c0075 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2fbf7c84460a98cf input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/_iomodule.c.h b/Modules/_io/clinic/_iomodule.c.h index 7cc738b6270e94..e6e5bf6951e552 100644 --- a/Modules/_io/clinic/_iomodule.c.h +++ b/Modules/_io/clinic/_iomodule.c.h @@ -161,7 +161,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw } if (args[1]) { if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("open", "2", "str", args[1]); + _PyArg_BadArgument("open", 2, "mode", "str", args[1]); goto exit; } Py_ssize_t mode_length; @@ -207,7 +207,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw } } else { - _PyArg_BadArgument("open", "4", "str or None", args[3]); + _PyArg_BadArgument("open", 4, "encoding", "str or None", args[3]); goto exit; } if (!--noptargs) { @@ -230,7 +230,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw } } else { - _PyArg_BadArgument("open", "5", "str or None", args[4]); + _PyArg_BadArgument("open", 5, "errors", "str or None", args[4]); goto exit; } if (!--noptargs) { @@ -253,7 +253,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw } } else { - _PyArg_BadArgument("open", "6", "str or None", args[5]); + _PyArg_BadArgument("open", 6, "newline", "str or None", args[5]); goto exit; } if (!--noptargs) { @@ -311,7 +311,7 @@ _io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("open_code", "1", "str", args[0]); + _PyArg_BadArgument("open_code", 1, "path", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -323,4 +323,4 @@ _io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=4803ae2e28c6093a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c9b417c2cdcf46cc input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bufferedio.c.h b/Modules/_io/clinic/bufferedio.c.h index 4f44f768602f97..7d4536462ac8ba 100644 --- a/Modules/_io/clinic/bufferedio.c.h +++ b/Modules/_io/clinic/bufferedio.c.h @@ -21,11 +21,11 @@ _io__BufferedIOBase_readinto(PyObject *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", "0", "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", 0, NULL, "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", "0", "contiguous buffer", arg); + _PyArg_BadArgument("readinto", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = _io__BufferedIOBase_readinto_impl(self, &buffer); @@ -58,11 +58,11 @@ _io__BufferedIOBase_readinto1(PyObject *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto1", "0", "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto1", 0, NULL, "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto1", "0", "contiguous buffer", arg); + _PyArg_BadArgument("readinto1", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = _io__BufferedIOBase_readinto1_impl(self, &buffer); @@ -243,11 +243,11 @@ _io__Buffered_readinto(buffered *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", "0", "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", 0, NULL, "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", "0", "contiguous buffer", arg); + _PyArg_BadArgument("readinto", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = _io__Buffered_readinto_impl(self, &buffer); @@ -280,11 +280,11 @@ _io__Buffered_readinto1(buffered *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto1", "0", "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto1", 0, NULL, "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto1", "0", "contiguous buffer", arg); + _PyArg_BadArgument("readinto1", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = _io__Buffered_readinto1_impl(self, &buffer); @@ -538,7 +538,7 @@ _io_BufferedWriter_write(buffered *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("write", "0", "contiguous buffer", arg); + _PyArg_BadArgument("write", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = _io_BufferedWriter_write_impl(self, &buffer); @@ -672,4 +672,4 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=1d16a1c2c71cb6b4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9a76e118fff43645 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bytesio.c.h b/Modules/_io/clinic/bytesio.c.h index 980d5390d2bcea..b2dba94cfcd548 100644 --- a/Modules/_io/clinic/bytesio.c.h +++ b/Modules/_io/clinic/bytesio.c.h @@ -319,11 +319,11 @@ _io_BytesIO_readinto(bytesio *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", "0", "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", 0, NULL, "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", "0", "contiguous buffer", arg); + _PyArg_BadArgument("readinto", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = _io_BytesIO_readinto_impl(self, &buffer); @@ -515,4 +515,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=0a0a11a282f553d4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=faf7289ed32a5e71 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/fileio.c.h b/Modules/_io/clinic/fileio.c.h index 26616f4f2a935b..f3e0adfc44d7c8 100644 --- a/Modules/_io/clinic/fileio.c.h +++ b/Modules/_io/clinic/fileio.c.h @@ -70,7 +70,7 @@ _io_FileIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) } if (fastargs[1]) { if (!PyUnicode_Check(fastargs[1])) { - _PyArg_BadArgument("FileIO", "2", "str", fastargs[1]); + _PyArg_BadArgument("FileIO", 2, "mode", "str", fastargs[1]); goto exit; } Py_ssize_t mode_length; @@ -200,11 +200,11 @@ _io_FileIO_readinto(fileio *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", "0", "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", 0, NULL, "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", "0", "contiguous buffer", arg); + _PyArg_BadArgument("readinto", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = _io_FileIO_readinto_impl(self, &buffer); @@ -303,7 +303,7 @@ _io_FileIO_write(fileio *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&b, 'C')) { - _PyArg_BadArgument("write", "0", "contiguous buffer", arg); + _PyArg_BadArgument("write", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = _io_FileIO_write_impl(self, &b); @@ -447,4 +447,4 @@ _io_FileIO_isatty(fileio *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO_FILEIO_TRUNCATE_METHODDEF #define _IO_FILEIO_TRUNCATE_METHODDEF #endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */ -/*[clinic end generated code: output=2f8b077f96ea12a2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a651c69701eccbaa input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/textio.c.h b/Modules/_io/clinic/textio.c.h index f4499de53e4a9a..b845e57c4d1243 100644 --- a/Modules/_io/clinic/textio.c.h +++ b/Modules/_io/clinic/textio.c.h @@ -229,7 +229,7 @@ _io_TextIOWrapper___init__(PyObject *self, PyObject *args, PyObject *kwargs) } } else { - _PyArg_BadArgument("TextIOWrapper", "2", "str or None", fastargs[1]); + _PyArg_BadArgument("TextIOWrapper", 2, "encoding", "str or None", fastargs[1]); goto exit; } if (!--noptargs) { @@ -258,7 +258,7 @@ _io_TextIOWrapper___init__(PyObject *self, PyObject *args, PyObject *kwargs) } } else { - _PyArg_BadArgument("TextIOWrapper", "4", "str or None", fastargs[3]); + _PyArg_BadArgument("TextIOWrapper", 4, "newline", "str or None", fastargs[3]); goto exit; } if (!--noptargs) { @@ -401,7 +401,7 @@ _io_TextIOWrapper_write(textio *self, PyObject *arg) PyObject *text; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("write", "0", "str", arg); + _PyArg_BadArgument("write", 0, NULL, "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -701,4 +701,4 @@ _io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored)) { return _io_TextIOWrapper_close_impl(self); } -/*[clinic end generated code: output=a38b219e50d81690 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=aa82a263f8ca3b83 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/winconsoleio.c.h b/Modules/_io/clinic/winconsoleio.c.h index e2b6960ca72f97..9d473bef9a4c2a 100644 --- a/Modules/_io/clinic/winconsoleio.c.h +++ b/Modules/_io/clinic/winconsoleio.c.h @@ -69,7 +69,7 @@ _io__WindowsConsoleIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) } if (fastargs[1]) { if (!PyUnicode_Check(fastargs[1])) { - _PyArg_BadArgument("_WindowsConsoleIO", "2", "str", fastargs[1]); + _PyArg_BadArgument("_WindowsConsoleIO", 2, "mode", "str", fastargs[1]); goto exit; } Py_ssize_t mode_length; @@ -200,11 +200,11 @@ _io__WindowsConsoleIO_readinto(winconsoleio *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", "0", "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", 0, NULL, "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", "0", "contiguous buffer", arg); + _PyArg_BadArgument("readinto", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = _io__WindowsConsoleIO_readinto_impl(self, &buffer); @@ -313,7 +313,7 @@ _io__WindowsConsoleIO_write(winconsoleio *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&b, 'C')) { - _PyArg_BadArgument("write", "0", "contiguous buffer", arg); + _PyArg_BadArgument("write", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = _io__WindowsConsoleIO_write_impl(self, &b); @@ -386,4 +386,4 @@ _io__WindowsConsoleIO_isatty(winconsoleio *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */ -/*[clinic end generated code: output=db52855ebb7ba931 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=114d178a4bce2d3c input=a9049054013a1b77]*/ diff --git a/Modules/_multiprocessing/clinic/posixshmem.c.h b/Modules/_multiprocessing/clinic/posixshmem.c.h index 7a6fb818d9b70a..7353da16e4ccf9 100644 --- a/Modules/_multiprocessing/clinic/posixshmem.c.h +++ b/Modules/_multiprocessing/clinic/posixshmem.c.h @@ -35,7 +35,7 @@ _posixshmem_shm_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("shm_open", "1", "str", args[0]); + _PyArg_BadArgument("shm_open", 1, "path", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -108,7 +108,7 @@ _posixshmem_shm_unlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("shm_unlink", "1", "str", args[0]); + _PyArg_BadArgument("shm_unlink", 1, "path", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -130,4 +130,4 @@ _posixshmem_shm_unlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs #ifndef _POSIXSHMEM_SHM_UNLINK_METHODDEF #define _POSIXSHMEM_SHM_UNLINK_METHODDEF #endif /* !defined(_POSIXSHMEM_SHM_UNLINK_METHODDEF) */ -/*[clinic end generated code: output=728a3d3486a48da5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0ca2e33a850af257 input=a9049054013a1b77]*/ diff --git a/Modules/cjkcodecs/clinic/multibytecodec.c.h b/Modules/cjkcodecs/clinic/multibytecodec.c.h index dabc5be119c1b8..f79255372e4328 100644 --- a/Modules/cjkcodecs/clinic/multibytecodec.c.h +++ b/Modules/cjkcodecs/clinic/multibytecodec.c.h @@ -55,7 +55,7 @@ _multibytecodec_MultibyteCodec_encode(MultibyteCodecObject *self, PyObject *cons } } else { - _PyArg_BadArgument("encode", "2", "str or None", args[1]); + _PyArg_BadArgument("encode", 2, "errors", "str or None", args[1]); goto exit; } skip_optional_pos: @@ -103,7 +103,7 @@ _multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject *cons goto exit; } if (!PyBuffer_IsContiguous(&input, 'C')) { - _PyArg_BadArgument("decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("decode", 1, "input", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -124,7 +124,7 @@ _multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject *cons } } else { - _PyArg_BadArgument("decode", "2", "str or None", args[1]); + _PyArg_BadArgument("decode", 2, "errors", "str or None", args[1]); goto exit; } skip_optional_pos: @@ -223,7 +223,7 @@ _multibytecodec_MultibyteIncrementalEncoder_setstate(MultibyteIncrementalEncoder PyLongObject *statelong; if (!PyLong_Check(arg)) { - _PyArg_BadArgument("setstate", "0", "int", arg); + _PyArg_BadArgument("setstate", 0, NULL, "int", arg); goto exit; } statelong = (PyLongObject *)arg; @@ -282,7 +282,7 @@ _multibytecodec_MultibyteIncrementalDecoder_decode(MultibyteIncrementalDecoderOb goto exit; } if (!PyBuffer_IsContiguous(&input, 'C')) { - _PyArg_BadArgument("decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("decode", 1, "input", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -345,7 +345,7 @@ _multibytecodec_MultibyteIncrementalDecoder_setstate(MultibyteIncrementalDecoder PyObject *state; if (!PyTuple_Check(arg)) { - _PyArg_BadArgument("setstate", "0", "tuple", arg); + _PyArg_BadArgument("setstate", 0, NULL, "tuple", arg); goto exit; } state = arg; @@ -525,4 +525,4 @@ PyDoc_STRVAR(_multibytecodec___create_codec__doc__, #define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \ {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__}, -/*[clinic end generated code: output=131713313f23dfd6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3e8d48c84507df24 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_bz2module.c.h b/Modules/clinic/_bz2module.c.h index 3827d43c4e3eef..c28f69b13fbfdd 100644 --- a/Modules/clinic/_bz2module.c.h +++ b/Modules/clinic/_bz2module.c.h @@ -29,7 +29,7 @@ _bz2_BZ2Compressor_compress(BZ2Compressor *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("compress", "0", "contiguous buffer", arg); + _PyArg_BadArgument("compress", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = _bz2_BZ2Compressor_compress_impl(self, &data); @@ -156,7 +156,7 @@ _bz2_BZ2Decompressor_decompress(BZ2Decompressor *self, PyObject *const *args, Py goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("decompress", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("decompress", 1, "data", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -220,4 +220,4 @@ _bz2_BZ2Decompressor___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=2cf12abaf4a7b18e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c3492ffd3d19acee input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_codecsmodule.c.h b/Modules/clinic/_codecsmodule.c.h index cdd05347c7f040..76d6828a447675 100644 --- a/Modules/clinic/_codecsmodule.c.h +++ b/Modules/clinic/_codecsmodule.c.h @@ -34,7 +34,7 @@ _codecs_lookup(PyObject *module, PyObject *arg) const char *encoding; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("lookup", "0", "str", arg); + _PyArg_BadArgument("lookup", 0, NULL, "str", arg); goto exit; } Py_ssize_t encoding_length; @@ -93,7 +93,7 @@ _codecs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[1]) { if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("encode", "2", "str", args[1]); + _PyArg_BadArgument("encode", 2, "encoding", "str", args[1]); goto exit; } Py_ssize_t encoding_length; @@ -110,7 +110,7 @@ _codecs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje } } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("encode", "3", "str", args[2]); + _PyArg_BadArgument("encode", 3, "errors", "str", args[2]); goto exit; } Py_ssize_t errors_length; @@ -170,7 +170,7 @@ _codecs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[1]) { if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("decode", "2", "str", args[1]); + _PyArg_BadArgument("decode", 2, "encoding", "str", args[1]); goto exit; } Py_ssize_t encoding_length; @@ -187,7 +187,7 @@ _codecs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje } } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("decode", "3", "str", args[2]); + _PyArg_BadArgument("decode", 3, "errors", "str", args[2]); goto exit; } Py_ssize_t errors_length; @@ -225,7 +225,7 @@ _codecs__forget_codec(PyObject *module, PyObject *arg) const char *encoding; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("_forget_codec", "0", "str", arg); + _PyArg_BadArgument("_forget_codec", 0, NULL, "str", arg); goto exit; } Py_ssize_t encoding_length; @@ -278,7 +278,7 @@ _codecs_escape_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("escape_decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("escape_decode", 1, NULL, "contiguous buffer", args[0]); goto exit; } } @@ -300,7 +300,7 @@ _codecs_escape_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("escape_decode", "2", "str or None", args[1]); + _PyArg_BadArgument("escape_decode", 2, NULL, "str or None", args[1]); goto exit; } skip_optional: @@ -338,7 +338,7 @@ _codecs_escape_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBytes_Check(args[0])) { - _PyArg_BadArgument("escape_encode", "1", "bytes", args[0]); + _PyArg_BadArgument("escape_encode", 1, NULL, "bytes", args[0]); goto exit; } data = args[0]; @@ -360,7 +360,7 @@ _codecs_escape_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("escape_encode", "2", "str or None", args[1]); + _PyArg_BadArgument("escape_encode", 2, NULL, "str or None", args[1]); goto exit; } skip_optional: @@ -397,7 +397,7 @@ _codecs_utf_7_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_7_decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_7_decode", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -418,7 +418,7 @@ _codecs_utf_7_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_7_decode", "2", "str or None", args[1]); + _PyArg_BadArgument("utf_7_decode", 2, NULL, "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -472,7 +472,7 @@ _codecs_utf_8_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_8_decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_8_decode", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -493,7 +493,7 @@ _codecs_utf_8_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_8_decode", "2", "str or None", args[1]); + _PyArg_BadArgument("utf_8_decode", 2, NULL, "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -547,7 +547,7 @@ _codecs_utf_16_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_16_decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_16_decode", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -568,7 +568,7 @@ _codecs_utf_16_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_16_decode", "2", "str or None", args[1]); + _PyArg_BadArgument("utf_16_decode", 2, NULL, "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -622,7 +622,7 @@ _codecs_utf_16_le_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_16_le_decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_16_le_decode", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -643,7 +643,7 @@ _codecs_utf_16_le_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_le_decode", "2", "str or None", args[1]); + _PyArg_BadArgument("utf_16_le_decode", 2, NULL, "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -697,7 +697,7 @@ _codecs_utf_16_be_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_16_be_decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_16_be_decode", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -718,7 +718,7 @@ _codecs_utf_16_be_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_be_decode", "2", "str or None", args[1]); + _PyArg_BadArgument("utf_16_be_decode", 2, NULL, "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -774,7 +774,7 @@ _codecs_utf_16_ex_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_16_ex_decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_16_ex_decode", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -795,7 +795,7 @@ _codecs_utf_16_ex_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_ex_decode", "2", "str or None", args[1]); + _PyArg_BadArgument("utf_16_ex_decode", 2, NULL, "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -861,7 +861,7 @@ _codecs_utf_32_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_32_decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_32_decode", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -882,7 +882,7 @@ _codecs_utf_32_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_32_decode", "2", "str or None", args[1]); + _PyArg_BadArgument("utf_32_decode", 2, NULL, "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -936,7 +936,7 @@ _codecs_utf_32_le_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_32_le_decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_32_le_decode", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -957,7 +957,7 @@ _codecs_utf_32_le_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_le_decode", "2", "str or None", args[1]); + _PyArg_BadArgument("utf_32_le_decode", 2, NULL, "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1011,7 +1011,7 @@ _codecs_utf_32_be_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_32_be_decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_32_be_decode", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1032,7 +1032,7 @@ _codecs_utf_32_be_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_be_decode", "2", "str or None", args[1]); + _PyArg_BadArgument("utf_32_be_decode", 2, NULL, "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1088,7 +1088,7 @@ _codecs_utf_32_ex_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_32_ex_decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_32_ex_decode", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1109,7 +1109,7 @@ _codecs_utf_32_ex_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_ex_decode", "2", "str or None", args[1]); + _PyArg_BadArgument("utf_32_ex_decode", 2, NULL, "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1183,7 +1183,7 @@ _codecs_unicode_escape_decode(PyObject *module, PyObject *const *args, Py_ssize_ goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("unicode_escape_decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("unicode_escape_decode", 1, NULL, "contiguous buffer", args[0]); goto exit; } } @@ -1205,7 +1205,7 @@ _codecs_unicode_escape_decode(PyObject *module, PyObject *const *args, Py_ssize_ } } else { - _PyArg_BadArgument("unicode_escape_decode", "2", "str or None", args[1]); + _PyArg_BadArgument("unicode_escape_decode", 2, NULL, "str or None", args[1]); goto exit; } skip_optional: @@ -1255,7 +1255,7 @@ _codecs_raw_unicode_escape_decode(PyObject *module, PyObject *const *args, Py_ss goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("raw_unicode_escape_decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("raw_unicode_escape_decode", 1, NULL, "contiguous buffer", args[0]); goto exit; } } @@ -1277,7 +1277,7 @@ _codecs_raw_unicode_escape_decode(PyObject *module, PyObject *const *args, Py_ss } } else { - _PyArg_BadArgument("raw_unicode_escape_decode", "2", "str or None", args[1]); + _PyArg_BadArgument("raw_unicode_escape_decode", 2, NULL, "str or None", args[1]); goto exit; } skip_optional: @@ -1318,7 +1318,7 @@ _codecs_latin_1_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("latin_1_decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("latin_1_decode", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1339,7 +1339,7 @@ _codecs_latin_1_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs } } else { - _PyArg_BadArgument("latin_1_decode", "2", "str or None", args[1]); + _PyArg_BadArgument("latin_1_decode", 2, NULL, "str or None", args[1]); goto exit; } skip_optional: @@ -1380,7 +1380,7 @@ _codecs_ascii_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("ascii_decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("ascii_decode", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1401,7 +1401,7 @@ _codecs_ascii_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("ascii_decode", "2", "str or None", args[1]); + _PyArg_BadArgument("ascii_decode", 2, NULL, "str or None", args[1]); goto exit; } skip_optional: @@ -1443,7 +1443,7 @@ _codecs_charmap_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("charmap_decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("charmap_decode", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1464,7 +1464,7 @@ _codecs_charmap_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs } } else { - _PyArg_BadArgument("charmap_decode", "2", "str or None", args[1]); + _PyArg_BadArgument("charmap_decode", 2, NULL, "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1512,7 +1512,7 @@ _codecs_mbcs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("mbcs_decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("mbcs_decode", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1533,7 +1533,7 @@ _codecs_mbcs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("mbcs_decode", "2", "str or None", args[1]); + _PyArg_BadArgument("mbcs_decode", 2, NULL, "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1591,7 +1591,7 @@ _codecs_oem_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("oem_decode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("oem_decode", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1612,7 +1612,7 @@ _codecs_oem_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("oem_decode", "2", "str or None", args[1]); + _PyArg_BadArgument("oem_decode", 2, NULL, "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1680,7 +1680,7 @@ _codecs_code_page_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("code_page_decode", "2", "contiguous buffer", args[1]); + _PyArg_BadArgument("code_page_decode", 2, NULL, "contiguous buffer", args[1]); goto exit; } if (nargs < 3) { @@ -1701,7 +1701,7 @@ _codecs_code_page_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("code_page_decode", "3", "str or None", args[2]); + _PyArg_BadArgument("code_page_decode", 3, NULL, "str or None", args[2]); goto exit; } if (nargs < 4) { @@ -1765,7 +1765,7 @@ _codecs_readbuffer_encode(PyObject *module, PyObject *const *args, Py_ssize_t na goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("readbuffer_encode", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("readbuffer_encode", 1, NULL, "contiguous buffer", args[0]); goto exit; } } @@ -1787,7 +1787,7 @@ _codecs_readbuffer_encode(PyObject *module, PyObject *const *args, Py_ssize_t na } } else { - _PyArg_BadArgument("readbuffer_encode", "2", "str or None", args[1]); + _PyArg_BadArgument("readbuffer_encode", 2, NULL, "str or None", args[1]); goto exit; } skip_optional: @@ -1825,7 +1825,7 @@ _codecs_utf_7_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_7_encode", "1", "str", args[0]); + _PyArg_BadArgument("utf_7_encode", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -1850,7 +1850,7 @@ _codecs_utf_7_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_7_encode", "2", "str or None", args[1]); + _PyArg_BadArgument("utf_7_encode", 2, NULL, "str or None", args[1]); goto exit; } skip_optional: @@ -1883,7 +1883,7 @@ _codecs_utf_8_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_8_encode", "1", "str", args[0]); + _PyArg_BadArgument("utf_8_encode", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -1908,7 +1908,7 @@ _codecs_utf_8_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_8_encode", "2", "str or None", args[1]); + _PyArg_BadArgument("utf_8_encode", 2, NULL, "str or None", args[1]); goto exit; } skip_optional: @@ -1942,7 +1942,7 @@ _codecs_utf_16_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_16_encode", "1", "str", args[0]); + _PyArg_BadArgument("utf_16_encode", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -1967,7 +1967,7 @@ _codecs_utf_16_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_16_encode", "2", "str or None", args[1]); + _PyArg_BadArgument("utf_16_encode", 2, NULL, "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -2012,7 +2012,7 @@ _codecs_utf_16_le_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_16_le_encode", "1", "str", args[0]); + _PyArg_BadArgument("utf_16_le_encode", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2037,7 +2037,7 @@ _codecs_utf_16_le_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_le_encode", "2", "str or None", args[1]); + _PyArg_BadArgument("utf_16_le_encode", 2, NULL, "str or None", args[1]); goto exit; } skip_optional: @@ -2070,7 +2070,7 @@ _codecs_utf_16_be_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_16_be_encode", "1", "str", args[0]); + _PyArg_BadArgument("utf_16_be_encode", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2095,7 +2095,7 @@ _codecs_utf_16_be_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_be_encode", "2", "str or None", args[1]); + _PyArg_BadArgument("utf_16_be_encode", 2, NULL, "str or None", args[1]); goto exit; } skip_optional: @@ -2129,7 +2129,7 @@ _codecs_utf_32_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_32_encode", "1", "str", args[0]); + _PyArg_BadArgument("utf_32_encode", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2154,7 +2154,7 @@ _codecs_utf_32_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_32_encode", "2", "str or None", args[1]); + _PyArg_BadArgument("utf_32_encode", 2, NULL, "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -2199,7 +2199,7 @@ _codecs_utf_32_le_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_32_le_encode", "1", "str", args[0]); + _PyArg_BadArgument("utf_32_le_encode", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2224,7 +2224,7 @@ _codecs_utf_32_le_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_le_encode", "2", "str or None", args[1]); + _PyArg_BadArgument("utf_32_le_encode", 2, NULL, "str or None", args[1]); goto exit; } skip_optional: @@ -2257,7 +2257,7 @@ _codecs_utf_32_be_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_32_be_encode", "1", "str", args[0]); + _PyArg_BadArgument("utf_32_be_encode", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2282,7 +2282,7 @@ _codecs_utf_32_be_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_be_encode", "2", "str or None", args[1]); + _PyArg_BadArgument("utf_32_be_encode", 2, NULL, "str or None", args[1]); goto exit; } skip_optional: @@ -2315,7 +2315,7 @@ _codecs_unicode_escape_encode(PyObject *module, PyObject *const *args, Py_ssize_ goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("unicode_escape_encode", "1", "str", args[0]); + _PyArg_BadArgument("unicode_escape_encode", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2340,7 +2340,7 @@ _codecs_unicode_escape_encode(PyObject *module, PyObject *const *args, Py_ssize_ } } else { - _PyArg_BadArgument("unicode_escape_encode", "2", "str or None", args[1]); + _PyArg_BadArgument("unicode_escape_encode", 2, NULL, "str or None", args[1]); goto exit; } skip_optional: @@ -2373,7 +2373,7 @@ _codecs_raw_unicode_escape_encode(PyObject *module, PyObject *const *args, Py_ss goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("raw_unicode_escape_encode", "1", "str", args[0]); + _PyArg_BadArgument("raw_unicode_escape_encode", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2398,7 +2398,7 @@ _codecs_raw_unicode_escape_encode(PyObject *module, PyObject *const *args, Py_ss } } else { - _PyArg_BadArgument("raw_unicode_escape_encode", "2", "str or None", args[1]); + _PyArg_BadArgument("raw_unicode_escape_encode", 2, NULL, "str or None", args[1]); goto exit; } skip_optional: @@ -2431,7 +2431,7 @@ _codecs_latin_1_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("latin_1_encode", "1", "str", args[0]); + _PyArg_BadArgument("latin_1_encode", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2456,7 +2456,7 @@ _codecs_latin_1_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs } } else { - _PyArg_BadArgument("latin_1_encode", "2", "str or None", args[1]); + _PyArg_BadArgument("latin_1_encode", 2, NULL, "str or None", args[1]); goto exit; } skip_optional: @@ -2489,7 +2489,7 @@ _codecs_ascii_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("ascii_encode", "1", "str", args[0]); + _PyArg_BadArgument("ascii_encode", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2514,7 +2514,7 @@ _codecs_ascii_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("ascii_encode", "2", "str or None", args[1]); + _PyArg_BadArgument("ascii_encode", 2, NULL, "str or None", args[1]); goto exit; } skip_optional: @@ -2548,7 +2548,7 @@ _codecs_charmap_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("charmap_encode", "1", "str", args[0]); + _PyArg_BadArgument("charmap_encode", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2573,7 +2573,7 @@ _codecs_charmap_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs } } else { - _PyArg_BadArgument("charmap_encode", "2", "str or None", args[1]); + _PyArg_BadArgument("charmap_encode", 2, NULL, "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -2605,7 +2605,7 @@ _codecs_charmap_build(PyObject *module, PyObject *arg) PyObject *map; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("charmap_build", "0", "str", arg); + _PyArg_BadArgument("charmap_build", 0, NULL, "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -2642,7 +2642,7 @@ _codecs_mbcs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("mbcs_encode", "1", "str", args[0]); + _PyArg_BadArgument("mbcs_encode", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2667,7 +2667,7 @@ _codecs_mbcs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("mbcs_encode", "2", "str or None", args[1]); + _PyArg_BadArgument("mbcs_encode", 2, NULL, "str or None", args[1]); goto exit; } skip_optional: @@ -2703,7 +2703,7 @@ _codecs_oem_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("oem_encode", "1", "str", args[0]); + _PyArg_BadArgument("oem_encode", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2728,7 +2728,7 @@ _codecs_oem_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("oem_encode", "2", "str or None", args[1]); + _PyArg_BadArgument("oem_encode", 2, NULL, "str or None", args[1]); goto exit; } skip_optional: @@ -2775,7 +2775,7 @@ _codecs_code_page_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("code_page_encode", "2", "str", args[1]); + _PyArg_BadArgument("code_page_encode", 2, NULL, "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -2800,7 +2800,7 @@ _codecs_code_page_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("code_page_encode", "3", "str or None", args[2]); + _PyArg_BadArgument("code_page_encode", 3, NULL, "str or None", args[2]); goto exit; } skip_optional: @@ -2840,7 +2840,7 @@ _codecs_register_error(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("register_error", "1", "str", args[0]); + _PyArg_BadArgument("register_error", 1, NULL, "str", args[0]); goto exit; } Py_ssize_t errors_length; @@ -2881,7 +2881,7 @@ _codecs_lookup_error(PyObject *module, PyObject *arg) const char *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("lookup_error", "0", "str", arg); + _PyArg_BadArgument("lookup_error", 0, NULL, "str", arg); goto exit; } Py_ssize_t name_length; @@ -2922,4 +2922,4 @@ _codecs_lookup_error(PyObject *module, PyObject *arg) #ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF #define _CODECS_CODE_PAGE_ENCODE_METHODDEF #endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */ -/*[clinic end generated code: output=e6c9bd2475b9a79f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=26916fab3ce5146a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_cryptmodule.c.h b/Modules/clinic/_cryptmodule.c.h index fef3d3881c8dbc..91f6d968b1d816 100644 --- a/Modules/clinic/_cryptmodule.c.h +++ b/Modules/clinic/_cryptmodule.c.h @@ -30,7 +30,7 @@ crypt_crypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("crypt", "1", "str", args[0]); + _PyArg_BadArgument("crypt", 1, NULL, "str", args[0]); goto exit; } Py_ssize_t word_length; @@ -43,7 +43,7 @@ crypt_crypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("crypt", "2", "str", args[1]); + _PyArg_BadArgument("crypt", 2, NULL, "str", args[1]); goto exit; } Py_ssize_t salt_length; @@ -60,4 +60,4 @@ crypt_crypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=634a3af1b403be9c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=589300f2e87a07a9 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_curses_panel.c.h b/Modules/clinic/_curses_panel.c.h index 5392086f0e0880..0d499b9f60efa7 100644 --- a/Modules/clinic/_curses_panel.c.h +++ b/Modules/clinic/_curses_panel.c.h @@ -214,7 +214,7 @@ _curses_panel_panel_replace(PyCursesPanelObject *self, PyObject *arg) PyCursesWindowObject *win; if (!PyObject_TypeCheck(arg, &PyCursesWindow_Type)) { - _PyArg_BadArgument("replace", "0", (&PyCursesWindow_Type)->tp_name, arg); + _PyArg_BadArgument("replace", 0, NULL, (&PyCursesWindow_Type)->tp_name, arg); goto exit; } win = (PyCursesWindowObject *)arg; @@ -288,7 +288,7 @@ _curses_panel_new_panel(PyObject *module, PyObject *arg) PyCursesWindowObject *win; if (!PyObject_TypeCheck(arg, &PyCursesWindow_Type)) { - _PyArg_BadArgument("new_panel", "0", (&PyCursesWindow_Type)->tp_name, arg); + _PyArg_BadArgument("new_panel", 0, NULL, (&PyCursesWindow_Type)->tp_name, arg); goto exit; } win = (PyCursesWindowObject *)arg; @@ -335,4 +335,4 @@ _curses_panel_update_panels(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _curses_panel_update_panels_impl(module); } -/*[clinic end generated code: output=056e7047370925fd input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b9ea85a52962e209 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_cursesmodule.c.h b/Modules/clinic/_cursesmodule.c.h index f24e4fdb09e489..0daf0e7d37e7e2 100644 --- a/Modules/clinic/_cursesmodule.c.h +++ b/Modules/clinic/_cursesmodule.c.h @@ -2521,7 +2521,7 @@ _curses_ungetmouse(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyLong_Check(args[4])) { - _PyArg_BadArgument("ungetmouse", "5", "int", args[4]); + _PyArg_BadArgument("ungetmouse", 5, NULL, "int", args[4]); goto exit; } bstate = PyLong_AsUnsignedLongMask(args[4]); @@ -3017,7 +3017,7 @@ _curses_setupterm(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO } } else { - _PyArg_BadArgument("setupterm", "1", "str or None", args[0]); + _PyArg_BadArgument("setupterm", 1, "term", "str or None", args[0]); goto exit; } if (!--noptargs) { @@ -3326,7 +3326,7 @@ _curses_mousemask(PyObject *module, PyObject *arg) unsigned long newmask; if (!PyLong_Check(arg)) { - _PyArg_BadArgument("mousemask", "0", "int", arg); + _PyArg_BadArgument("mousemask", 0, NULL, "int", arg); goto exit; } newmask = PyLong_AsUnsignedLongMask(arg); @@ -4201,7 +4201,7 @@ _curses_tigetflag(PyObject *module, PyObject *arg) const char *capname; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("tigetflag", "0", "str", arg); + _PyArg_BadArgument("tigetflag", 0, NULL, "str", arg); goto exit; } Py_ssize_t capname_length; @@ -4244,7 +4244,7 @@ _curses_tigetnum(PyObject *module, PyObject *arg) const char *capname; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("tigetnum", "0", "str", arg); + _PyArg_BadArgument("tigetnum", 0, NULL, "str", arg); goto exit; } Py_ssize_t capname_length; @@ -4287,7 +4287,7 @@ _curses_tigetstr(PyObject *module, PyObject *arg) const char *capname; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("tigetstr", "0", "str", arg); + _PyArg_BadArgument("tigetstr", 0, NULL, "str", arg); goto exit; } Py_ssize_t capname_length; @@ -4569,4 +4569,4 @@ _curses_use_default_colors(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef _CURSES_USE_DEFAULT_COLORS_METHODDEF #define _CURSES_USE_DEFAULT_COLORS_METHODDEF #endif /* !defined(_CURSES_USE_DEFAULT_COLORS_METHODDEF) */ -/*[clinic end generated code: output=6be3c7512f474c3b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b79d2d74391a91ff input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_dbmmodule.c.h b/Modules/clinic/_dbmmodule.c.h index b502919fc2e316..2385ceee1da4b0 100644 --- a/Modules/clinic/_dbmmodule.c.h +++ b/Modules/clinic/_dbmmodule.c.h @@ -136,7 +136,7 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("open", "1", "str", args[0]); + _PyArg_BadArgument("open", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -147,7 +147,7 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("open", "2", "str", args[1]); + _PyArg_BadArgument("open", 2, NULL, "str", args[1]); goto exit; } Py_ssize_t flags_length; @@ -177,4 +177,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=4fdf444215483628 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=bbaecc68a23e54d7 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_elementtree.c.h b/Modules/clinic/_elementtree.c.h index 62d003763d4981..2dc1334a283589 100644 --- a/Modules/clinic/_elementtree.c.h +++ b/Modules/clinic/_elementtree.c.h @@ -20,7 +20,7 @@ _elementtree_Element_append(ElementObject *self, PyObject *arg) PyObject *subelement; if (!PyObject_TypeCheck(arg, &Element_Type)) { - _PyArg_BadArgument("append", "0", (&Element_Type)->tp_name, arg); + _PyArg_BadArgument("append", 0, NULL, (&Element_Type)->tp_name, arg); goto exit; } subelement = arg; @@ -82,7 +82,7 @@ _elementtree_Element___deepcopy__(ElementObject *self, PyObject *arg) PyObject *memo; if (!PyDict_Check(arg)) { - _PyArg_BadArgument("__deepcopy__", "0", "dict", arg); + _PyArg_BadArgument("__deepcopy__", 0, NULL, "dict", arg); goto exit; } memo = arg; @@ -501,7 +501,7 @@ _elementtree_Element_insert(ElementObject *self, PyObject *const *args, Py_ssize index = ival; } if (!PyObject_TypeCheck(args[1], &Element_Type)) { - _PyArg_BadArgument("insert", "2", (&Element_Type)->tp_name, args[1]); + _PyArg_BadArgument("insert", 2, NULL, (&Element_Type)->tp_name, args[1]); goto exit; } subelement = args[1]; @@ -593,7 +593,7 @@ _elementtree_Element_remove(ElementObject *self, PyObject *arg) PyObject *subelement; if (!PyObject_TypeCheck(arg, &Element_Type)) { - _PyArg_BadArgument("remove", "0", (&Element_Type)->tp_name, arg); + _PyArg_BadArgument("remove", 0, NULL, (&Element_Type)->tp_name, arg); goto exit; } subelement = arg; @@ -892,7 +892,7 @@ _elementtree_XMLParser___init__(PyObject *self, PyObject *args, PyObject *kwargs } } else { - _PyArg_BadArgument("XMLParser", "'encoding'", "str or None", fastargs[1]); + _PyArg_BadArgument("XMLParser", 2, "encoding", "str or None", fastargs[1]); goto exit; } skip_optional_kwonly: @@ -969,4 +969,4 @@ _elementtree_XMLParser__setevents(XMLParserObject *self, PyObject *const *args, exit: return return_value; } -/*[clinic end generated code: output=8816432a896a50f8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7c113ba1f9ac82ff input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_gdbmmodule.c.h b/Modules/clinic/_gdbmmodule.c.h index ac6a7b046deeb1..a370ebf47e15ed 100644 --- a/Modules/clinic/_gdbmmodule.c.h +++ b/Modules/clinic/_gdbmmodule.c.h @@ -257,7 +257,7 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("open", "1", "str", args[0]); + _PyArg_BadArgument("open", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -268,7 +268,7 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("open", "2", "str", args[1]); + _PyArg_BadArgument("open", 2, NULL, "str", args[1]); goto exit; } Py_ssize_t flags_length; @@ -298,4 +298,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=199ac3c55b5f8718 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ce9ed8c29a10355e input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_hashopenssl.c.h b/Modules/clinic/_hashopenssl.c.h index 5445b9efb94c9c..416e0e5826afd7 100644 --- a/Modules/clinic/_hashopenssl.c.h +++ b/Modules/clinic/_hashopenssl.c.h @@ -145,7 +145,7 @@ pbkdf2_hmac(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("pbkdf2_hmac", "1", "str", args[0]); + _PyArg_BadArgument("pbkdf2_hmac", 1, "hash_name", "str", args[0]); goto exit; } Py_ssize_t hash_name_length; @@ -161,14 +161,14 @@ pbkdf2_hmac(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyBuffer_IsContiguous(&password, 'C')) { - _PyArg_BadArgument("pbkdf2_hmac", "2", "contiguous buffer", args[1]); + _PyArg_BadArgument("pbkdf2_hmac", 2, "password", "contiguous buffer", args[1]); goto exit; } if (PyObject_GetBuffer(args[2], &salt, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&salt, 'C')) { - _PyArg_BadArgument("pbkdf2_hmac", "3", "contiguous buffer", args[2]); + _PyArg_BadArgument("pbkdf2_hmac", 3, "salt", "contiguous buffer", args[2]); goto exit; } if (PyFloat_Check(args[3])) { @@ -243,7 +243,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&password, 'C')) { - _PyArg_BadArgument("scrypt", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("scrypt", 1, "password", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -254,7 +254,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&salt, 'C')) { - _PyArg_BadArgument("scrypt", "'salt'", "contiguous buffer", args[1]); + _PyArg_BadArgument("scrypt", 2, "salt", "contiguous buffer", args[1]); goto exit; } if (!--noptargs) { @@ -263,7 +263,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj } if (args[2]) { if (!PyLong_Check(args[2])) { - _PyArg_BadArgument("scrypt", "'n'", "int", args[2]); + _PyArg_BadArgument("scrypt", 3, "n", "int", args[2]); goto exit; } n_obj = args[2]; @@ -273,7 +273,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj } if (args[3]) { if (!PyLong_Check(args[3])) { - _PyArg_BadArgument("scrypt", "'r'", "int", args[3]); + _PyArg_BadArgument("scrypt", 4, "r", "int", args[3]); goto exit; } r_obj = args[3]; @@ -283,7 +283,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj } if (args[4]) { if (!PyLong_Check(args[4])) { - _PyArg_BadArgument("scrypt", "'p'", "int", args[4]); + _PyArg_BadArgument("scrypt", 5, "p", "int", args[4]); goto exit; } p_obj = args[4]; @@ -364,18 +364,18 @@ _hashlib_hmac_digest(PyObject *module, PyObject *const *args, Py_ssize_t nargs, goto exit; } if (!PyBuffer_IsContiguous(&key, 'C')) { - _PyArg_BadArgument("hmac_digest", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("hmac_digest", 1, "key", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &msg, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&msg, 'C')) { - _PyArg_BadArgument("hmac_digest", "2", "contiguous buffer", args[1]); + _PyArg_BadArgument("hmac_digest", 2, "msg", "contiguous buffer", args[1]); goto exit; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("hmac_digest", "3", "str", args[2]); + _PyArg_BadArgument("hmac_digest", 3, "digest", "str", args[2]); goto exit; } Py_ssize_t digest_length; @@ -409,4 +409,4 @@ _hashlib_hmac_digest(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #ifndef _HASHLIB_SCRYPT_METHODDEF #define _HASHLIB_SCRYPT_METHODDEF #endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */ -/*[clinic end generated code: output=0625639de9103841 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d19b13b0a11cd8d3 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_lzmamodule.c.h b/Modules/clinic/_lzmamodule.c.h index 3c305dccbf1ca6..37e25a6611f5e8 100644 --- a/Modules/clinic/_lzmamodule.c.h +++ b/Modules/clinic/_lzmamodule.c.h @@ -29,7 +29,7 @@ _lzma_LZMACompressor_compress(Compressor *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("compress", "0", "contiguous buffer", arg); + _PyArg_BadArgument("compress", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = _lzma_LZMACompressor_compress_impl(self, &data); @@ -110,7 +110,7 @@ _lzma_LZMADecompressor_decompress(Decompressor *self, PyObject *const *args, Py_ goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("decompress", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("decompress", 1, "data", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -321,7 +321,7 @@ _lzma__decode_filter_properties(PyObject *module, PyObject *const *args, Py_ssiz goto exit; } if (!PyBuffer_IsContiguous(&encoded_props, 'C')) { - _PyArg_BadArgument("_decode_filter_properties", "2", "contiguous buffer", args[1]); + _PyArg_BadArgument("_decode_filter_properties", 2, NULL, "contiguous buffer", args[1]); goto exit; } return_value = _lzma__decode_filter_properties_impl(module, filter_id, &encoded_props); @@ -334,4 +334,4 @@ _lzma__decode_filter_properties(PyObject *module, PyObject *const *args, Py_ssiz return return_value; } -/*[clinic end generated code: output=1ff47f46a3e7c6ea input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d3e401d5134c008f input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_pickle.c.h b/Modules/clinic/_pickle.c.h index e30cd1471aae33..58dca4977b2f76 100644 --- a/Modules/clinic/_pickle.c.h +++ b/Modules/clinic/_pickle.c.h @@ -356,7 +356,7 @@ _pickle_Unpickler___init__(PyObject *self, PyObject *args, PyObject *kwargs) } if (fastargs[2]) { if (!PyUnicode_Check(fastargs[2])) { - _PyArg_BadArgument("Unpickler", "'encoding'", "str", fastargs[2]); + _PyArg_BadArgument("Unpickler", 3, "encoding", "str", fastargs[2]); goto exit; } Py_ssize_t encoding_length; @@ -374,7 +374,7 @@ _pickle_Unpickler___init__(PyObject *self, PyObject *args, PyObject *kwargs) } if (fastargs[3]) { if (!PyUnicode_Check(fastargs[3])) { - _PyArg_BadArgument("Unpickler", "'errors'", "str", fastargs[3]); + _PyArg_BadArgument("Unpickler", 4, "errors", "str", fastargs[3]); goto exit; } Py_ssize_t errors_length; @@ -691,7 +691,7 @@ _pickle_load(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject } if (args[2]) { if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("load", "'encoding'", "str", args[2]); + _PyArg_BadArgument("load", 3, "encoding", "str", args[2]); goto exit; } Py_ssize_t encoding_length; @@ -709,7 +709,7 @@ _pickle_load(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject } if (args[3]) { if (!PyUnicode_Check(args[3])) { - _PyArg_BadArgument("load", "'errors'", "str", args[3]); + _PyArg_BadArgument("load", 4, "errors", "str", args[3]); goto exit; } Py_ssize_t errors_length; @@ -794,7 +794,7 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec } if (args[2]) { if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("loads", "'encoding'", "str", args[2]); + _PyArg_BadArgument("loads", 3, "encoding", "str", args[2]); goto exit; } Py_ssize_t encoding_length; @@ -812,7 +812,7 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec } if (args[3]) { if (!PyUnicode_Check(args[3])) { - _PyArg_BadArgument("loads", "'errors'", "str", args[3]); + _PyArg_BadArgument("loads", 4, "errors", "str", args[3]); goto exit; } Py_ssize_t errors_length; @@ -835,4 +835,4 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=7eebae00cf0a4457 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2dcf493ea059a277 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_sre.c.h b/Modules/clinic/_sre.c.h index be2469b937be91..c72e90d3cdf76f 100644 --- a/Modules/clinic/_sre.c.h +++ b/Modules/clinic/_sre.c.h @@ -894,7 +894,7 @@ _sre_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyList_Check(args[2])) { - _PyArg_BadArgument("compile", "3", "list", args[2]); + _PyArg_BadArgument("compile", 3, "code", "list", args[2]); goto exit; } code = args[2]; @@ -916,12 +916,12 @@ _sre_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject groups = ival; } if (!PyDict_Check(args[4])) { - _PyArg_BadArgument("compile", "5", "dict", args[4]); + _PyArg_BadArgument("compile", 5, "groupindex", "dict", args[4]); goto exit; } groupindex = args[4]; if (!PyTuple_Check(args[5])) { - _PyArg_BadArgument("compile", "6", "tuple", args[5]); + _PyArg_BadArgument("compile", 6, "indexgroup", "tuple", args[5]); goto exit; } indexgroup = args[5]; @@ -1207,4 +1207,4 @@ _sre_SRE_Scanner_search(ScannerObject *self, PyObject *Py_UNUSED(ignored)) { return _sre_SRE_Scanner_search_impl(self); } -/*[clinic end generated code: output=25395ef086008eb8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2ffd8eb155f22c72 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_ssl.c.h b/Modules/clinic/_ssl.c.h index 641afd73384237..48011ec3eb4eef 100644 --- a/Modules/clinic/_ssl.c.h +++ b/Modules/clinic/_ssl.c.h @@ -222,7 +222,7 @@ _ssl__SSLSocket_write(PySSLSocket *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&b, 'C')) { - _PyArg_BadArgument("write", "0", "contiguous buffer", arg); + _PyArg_BadArgument("write", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = _ssl__SSLSocket_write_impl(self, &b); @@ -353,7 +353,7 @@ _ssl__SSLSocket_get_channel_binding(PySSLSocket *self, PyObject *const *args, Py goto skip_optional_pos; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("get_channel_binding", "1", "str", args[0]); + _PyArg_BadArgument("get_channel_binding", 1, "cb_type", "str", args[0]); goto exit; } Py_ssize_t cb_type_length; @@ -439,7 +439,7 @@ _ssl__SSLContext_set_ciphers(PySSLContext *self, PyObject *arg) const char *cipherlist; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("set_ciphers", "0", "str", arg); + _PyArg_BadArgument("set_ciphers", 0, NULL, "str", arg); goto exit; } Py_ssize_t cipherlist_length; @@ -500,7 +500,7 @@ _ssl__SSLContext__set_npn_protocols(PySSLContext *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&protos, 'C')) { - _PyArg_BadArgument("_set_npn_protocols", "0", "contiguous buffer", arg); + _PyArg_BadArgument("_set_npn_protocols", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = _ssl__SSLContext__set_npn_protocols_impl(self, &protos); @@ -536,7 +536,7 @@ _ssl__SSLContext__set_alpn_protocols(PySSLContext *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&protos, 'C')) { - _PyArg_BadArgument("_set_alpn_protocols", "0", "contiguous buffer", arg); + _PyArg_BadArgument("_set_alpn_protocols", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = _ssl__SSLContext__set_alpn_protocols_impl(self, &protos); @@ -690,7 +690,7 @@ _ssl__SSLContext__wrap_socket(PySSLContext *self, PyObject *const *args, Py_ssiz goto exit; } if (!PyObject_TypeCheck(args[0], PySocketModule.Sock_Type)) { - _PyArg_BadArgument("_wrap_socket", "1", (PySocketModule.Sock_Type)->tp_name, args[0]); + _PyArg_BadArgument("_wrap_socket", 1, "sock", (PySocketModule.Sock_Type)->tp_name, args[0]); goto exit; } sock = args[0]; @@ -765,12 +765,12 @@ _ssl__SSLContext__wrap_bio(PySSLContext *self, PyObject *const *args, Py_ssize_t goto exit; } if (!PyObject_TypeCheck(args[0], &PySSLMemoryBIO_Type)) { - _PyArg_BadArgument("_wrap_bio", "1", (&PySSLMemoryBIO_Type)->tp_name, args[0]); + _PyArg_BadArgument("_wrap_bio", 1, "incoming", (&PySSLMemoryBIO_Type)->tp_name, args[0]); goto exit; } incoming = (PySSLMemoryBIO *)args[0]; if (!PyObject_TypeCheck(args[1], &PySSLMemoryBIO_Type)) { - _PyArg_BadArgument("_wrap_bio", "2", (&PySSLMemoryBIO_Type)->tp_name, args[1]); + _PyArg_BadArgument("_wrap_bio", 2, "outgoing", (&PySSLMemoryBIO_Type)->tp_name, args[1]); goto exit; } outgoing = (PySSLMemoryBIO *)args[1]; @@ -1017,7 +1017,7 @@ _ssl_MemoryBIO_write(PySSLMemoryBIO *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&b, 'C')) { - _PyArg_BadArgument("write", "0", "contiguous buffer", arg); + _PyArg_BadArgument("write", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = _ssl_MemoryBIO_write_impl(self, &b); @@ -1089,7 +1089,7 @@ _ssl_RAND_add(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&view, 'C')) { - _PyArg_BadArgument("RAND_add", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("RAND_add", 1, NULL, "contiguous buffer", args[0]); goto exit; } } @@ -1283,7 +1283,7 @@ _ssl_txt2obj(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("txt2obj", "1", "str", args[0]); + _PyArg_BadArgument("txt2obj", 1, "txt", "str", args[0]); goto exit; } Py_ssize_t txt_length; @@ -1376,7 +1376,7 @@ _ssl_enum_certificates(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("enum_certificates", "1", "str", args[0]); + _PyArg_BadArgument("enum_certificates", 1, "store_name", "str", args[0]); goto exit; } Py_ssize_t store_name_length; @@ -1429,7 +1429,7 @@ _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("enum_crls", "1", "str", args[0]); + _PyArg_BadArgument("enum_crls", 1, "store_name", "str", args[0]); goto exit; } Py_ssize_t store_name_length; @@ -1476,4 +1476,4 @@ _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #ifndef _SSL_ENUM_CRLS_METHODDEF #define _SSL_ENUM_CRLS_METHODDEF #endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */ -/*[clinic end generated code: output=84486c0b3f6fed92 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=88820c4fd517a256 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_struct.c.h b/Modules/clinic/_struct.c.h index 1dc1c0605d2b03..0143ae930501df 100644 --- a/Modules/clinic/_struct.c.h +++ b/Modules/clinic/_struct.c.h @@ -65,7 +65,7 @@ Struct_unpack(PyStructObject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack", "0", "contiguous buffer", arg); + _PyArg_BadArgument("unpack", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = Struct_unpack_impl(self, &buffer); @@ -118,7 +118,7 @@ Struct_unpack_from(PyStructObject *self, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack_from", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("unpack_from", 1, "buffer", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -253,7 +253,7 @@ unpack(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack", "2", "contiguous buffer", args[1]); + _PyArg_BadArgument("unpack", 2, NULL, "contiguous buffer", args[1]); goto exit; } return_value = unpack_impl(module, s_object, &buffer); @@ -309,7 +309,7 @@ unpack_from(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack_from", "2", "contiguous buffer", args[1]); + _PyArg_BadArgument("unpack_from", 2, "buffer", "contiguous buffer", args[1]); goto exit; } if (!noptargs) { @@ -386,4 +386,4 @@ iter_unpack(PyObject *module, PyObject *const *args, Py_ssize_t nargs) return return_value; } -/*[clinic end generated code: output=3bc4b57a65898202 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e1a3a392ad2e2784 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_tkinter.c.h b/Modules/clinic/_tkinter.c.h index 5f149ccc66ec4d..ffe86b9f76ac6f 100644 --- a/Modules/clinic/_tkinter.c.h +++ b/Modules/clinic/_tkinter.c.h @@ -20,7 +20,7 @@ _tkinter_tkapp_eval(TkappObject *self, PyObject *arg) const char *script; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("eval", "0", "str", arg); + _PyArg_BadArgument("eval", 0, NULL, "str", arg); goto exit; } Py_ssize_t script_length; @@ -56,7 +56,7 @@ _tkinter_tkapp_evalfile(TkappObject *self, PyObject *arg) const char *fileName; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("evalfile", "0", "str", arg); + _PyArg_BadArgument("evalfile", 0, NULL, "str", arg); goto exit; } Py_ssize_t fileName_length; @@ -92,7 +92,7 @@ _tkinter_tkapp_record(TkappObject *self, PyObject *arg) const char *script; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("record", "0", "str", arg); + _PyArg_BadArgument("record", 0, NULL, "str", arg); goto exit; } Py_ssize_t script_length; @@ -128,7 +128,7 @@ _tkinter_tkapp_adderrorinfo(TkappObject *self, PyObject *arg) const char *msg; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("adderrorinfo", "0", "str", arg); + _PyArg_BadArgument("adderrorinfo", 0, NULL, "str", arg); goto exit; } Py_ssize_t msg_length; @@ -188,7 +188,7 @@ _tkinter_tkapp_exprstring(TkappObject *self, PyObject *arg) const char *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("exprstring", "0", "str", arg); + _PyArg_BadArgument("exprstring", 0, NULL, "str", arg); goto exit; } Py_ssize_t s_length; @@ -224,7 +224,7 @@ _tkinter_tkapp_exprlong(TkappObject *self, PyObject *arg) const char *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("exprlong", "0", "str", arg); + _PyArg_BadArgument("exprlong", 0, NULL, "str", arg); goto exit; } Py_ssize_t s_length; @@ -260,7 +260,7 @@ _tkinter_tkapp_exprdouble(TkappObject *self, PyObject *arg) const char *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("exprdouble", "0", "str", arg); + _PyArg_BadArgument("exprdouble", 0, NULL, "str", arg); goto exit; } Py_ssize_t s_length; @@ -296,7 +296,7 @@ _tkinter_tkapp_exprboolean(TkappObject *self, PyObject *arg) const char *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("exprboolean", "0", "str", arg); + _PyArg_BadArgument("exprboolean", 0, NULL, "str", arg); goto exit; } Py_ssize_t s_length; @@ -353,7 +353,7 @@ _tkinter_tkapp_createcommand(TkappObject *self, PyObject *const *args, Py_ssize_ goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("createcommand", "1", "str", args[0]); + _PyArg_BadArgument("createcommand", 1, NULL, "str", args[0]); goto exit; } Py_ssize_t name_length; @@ -390,7 +390,7 @@ _tkinter_tkapp_deletecommand(TkappObject *self, PyObject *arg) const char *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("deletecommand", "0", "str", arg); + _PyArg_BadArgument("deletecommand", 0, NULL, "str", arg); goto exit; } Py_ssize_t name_length; @@ -731,14 +731,14 @@ _tkinter_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("create", "1", "str or None", args[0]); + _PyArg_BadArgument("create", 1, NULL, "str or None", args[0]); goto exit; } if (nargs < 2) { goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("create", "2", "str", args[1]); + _PyArg_BadArgument("create", 2, NULL, "str", args[1]); goto exit; } Py_ssize_t baseName_length; @@ -754,7 +754,7 @@ _tkinter_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("create", "3", "str", args[2]); + _PyArg_BadArgument("create", 3, NULL, "str", args[2]); goto exit; } Py_ssize_t className_length; @@ -832,7 +832,7 @@ _tkinter_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("create", "8", "str or None", args[7]); + _PyArg_BadArgument("create", 8, NULL, "str or None", args[7]); goto exit; } skip_optional: @@ -912,4 +912,4 @@ _tkinter_getbusywaitinterval(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */ -/*[clinic end generated code: output=1cff0b064379741c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1c1c508370348cfa input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_weakref.c.h b/Modules/clinic/_weakref.c.h index 6c801d8928d970..9effdd0d307ab8 100644 --- a/Modules/clinic/_weakref.c.h +++ b/Modules/clinic/_weakref.c.h @@ -54,7 +54,7 @@ _weakref__remove_dead_weakref(PyObject *module, PyObject *const *args, Py_ssize_ goto exit; } if (!PyDict_Check(args[0])) { - _PyArg_BadArgument("_remove_dead_weakref", "1", "dict", args[0]); + _PyArg_BadArgument("_remove_dead_weakref", 1, NULL, "dict", args[0]); goto exit; } dct = args[0]; @@ -64,4 +64,4 @@ _weakref__remove_dead_weakref(PyObject *module, PyObject *const *args, Py_ssize_ exit: return return_value; } -/*[clinic end generated code: output=e8198041e5e17520 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1b199568ba883fb0 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/arraymodule.c.h b/Modules/clinic/arraymodule.c.h index 45dc2eeb59e64b..488925e2be0373 100644 --- a/Modules/clinic/arraymodule.c.h +++ b/Modules/clinic/arraymodule.c.h @@ -345,7 +345,7 @@ array_array_fromstring(arrayobject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("fromstring", "0", "contiguous buffer", arg); + _PyArg_BadArgument("fromstring", 0, NULL, "contiguous buffer", arg); goto exit; } } @@ -382,7 +382,7 @@ array_array_frombytes(arrayobject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("frombytes", "0", "contiguous buffer", arg); + _PyArg_BadArgument("frombytes", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = array_array_frombytes_impl(self, &buffer); @@ -537,14 +537,14 @@ array__array_reconstructor(PyObject *module, PyObject *const *args, Py_ssize_t n } arraytype = (PyTypeObject *)args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("_array_reconstructor", "2", "a unicode character", args[1]); + _PyArg_BadArgument("_array_reconstructor", 2, NULL, "a unicode character", args[1]); goto exit; } if (PyUnicode_READY(args[1])) { goto exit; } if (PyUnicode_GET_LENGTH(args[1]) != 1) { - _PyArg_BadArgument("_array_reconstructor", "2", "a unicode character", args[1]); + _PyArg_BadArgument("_array_reconstructor", 2, NULL, "a unicode character", args[1]); goto exit; } typecode = PyUnicode_READ_CHAR(args[1], 0); @@ -599,4 +599,4 @@ PyDoc_STRVAR(array_arrayiterator___setstate____doc__, #define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \ {"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__}, -/*[clinic end generated code: output=c4ad31a0e13f4b42 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e7e76ee4c4f6d313 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/audioop.c.h b/Modules/clinic/audioop.c.h index cc3bc424cd73d0..a546ae820691b4 100644 --- a/Modules/clinic/audioop.c.h +++ b/Modules/clinic/audioop.c.h @@ -30,7 +30,7 @@ audioop_getsample(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("getsample", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("getsample", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -96,7 +96,7 @@ audioop_max(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("max", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("max", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -145,7 +145,7 @@ audioop_minmax(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("minmax", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("minmax", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -194,7 +194,7 @@ audioop_avg(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("avg", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("avg", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -243,7 +243,7 @@ audioop_rms(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("rms", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("rms", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -293,14 +293,14 @@ audioop_findfit(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("findfit", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("findfit", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &reference, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&reference, 'C')) { - _PyArg_BadArgument("findfit", "2", "contiguous buffer", args[1]); + _PyArg_BadArgument("findfit", 2, NULL, "contiguous buffer", args[1]); goto exit; } return_value = audioop_findfit_impl(module, &fragment, &reference); @@ -345,14 +345,14 @@ audioop_findfactor(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("findfactor", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("findfactor", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &reference, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&reference, 'C')) { - _PyArg_BadArgument("findfactor", "2", "contiguous buffer", args[1]); + _PyArg_BadArgument("findfactor", 2, NULL, "contiguous buffer", args[1]); goto exit; } return_value = audioop_findfactor_impl(module, &fragment, &reference); @@ -397,7 +397,7 @@ audioop_findmax(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("findmax", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("findmax", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -454,7 +454,7 @@ audioop_avgpp(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("avgpp", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("avgpp", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -503,7 +503,7 @@ audioop_maxpp(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("maxpp", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("maxpp", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -552,7 +552,7 @@ audioop_cross(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("cross", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("cross", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -603,7 +603,7 @@ audioop_mul(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("mul", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("mul", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -659,7 +659,7 @@ audioop_tomono(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("tomono", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("tomono", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -719,7 +719,7 @@ audioop_tostereo(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("tostereo", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("tostereo", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -778,14 +778,14 @@ audioop_add(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment1, 'C')) { - _PyArg_BadArgument("add", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("add", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &fragment2, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&fragment2, 'C')) { - _PyArg_BadArgument("add", "2", "contiguous buffer", args[1]); + _PyArg_BadArgument("add", 2, NULL, "contiguous buffer", args[1]); goto exit; } if (PyFloat_Check(args[2])) { @@ -839,7 +839,7 @@ audioop_bias(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("bias", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("bias", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -897,7 +897,7 @@ audioop_reverse(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("reverse", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("reverse", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -946,7 +946,7 @@ audioop_byteswap(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("byteswap", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("byteswap", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -997,7 +997,7 @@ audioop_lin2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("lin2lin", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("lin2lin", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1064,7 +1064,7 @@ audioop_ratecv(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("ratecv", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("ratecv", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1166,7 +1166,7 @@ audioop_lin2ulaw(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("lin2ulaw", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("lin2ulaw", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1215,7 +1215,7 @@ audioop_ulaw2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("ulaw2lin", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("ulaw2lin", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1264,7 +1264,7 @@ audioop_lin2alaw(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("lin2alaw", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("lin2alaw", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1313,7 +1313,7 @@ audioop_alaw2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("alaw2lin", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("alaw2lin", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1364,7 +1364,7 @@ audioop_lin2adpcm(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("lin2adpcm", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("lin2adpcm", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1416,7 +1416,7 @@ audioop_adpcm2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("adpcm2lin", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("adpcm2lin", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1439,4 +1439,4 @@ audioop_adpcm2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) return return_value; } -/*[clinic end generated code: output=ef58fafc4686726a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=19ad2c873a7f1352 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/binascii.c.h b/Modules/clinic/binascii.c.h index 2df2acc8a3567a..d114d2bbed0099 100644 --- a/Modules/clinic/binascii.c.h +++ b/Modules/clinic/binascii.c.h @@ -64,7 +64,7 @@ binascii_b2a_uu(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_uu", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("b2a_uu", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -153,7 +153,7 @@ binascii_b2a_base64(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_base64", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("b2a_base64", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -233,7 +233,7 @@ binascii_rlecode_hqx(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("rlecode_hqx", "0", "contiguous buffer", arg); + _PyArg_BadArgument("rlecode_hqx", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = binascii_rlecode_hqx_impl(module, &data); @@ -269,7 +269,7 @@ binascii_b2a_hqx(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_hqx", "0", "contiguous buffer", arg); + _PyArg_BadArgument("b2a_hqx", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = binascii_b2a_hqx_impl(module, &data); @@ -305,7 +305,7 @@ binascii_rledecode_hqx(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("rledecode_hqx", "0", "contiguous buffer", arg); + _PyArg_BadArgument("rledecode_hqx", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = binascii_rledecode_hqx_impl(module, &data); @@ -346,7 +346,7 @@ binascii_crc_hqx(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("crc_hqx", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("crc_hqx", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -400,7 +400,7 @@ binascii_crc32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("crc32", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("crc32", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -456,7 +456,7 @@ binascii_b2a_hex(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_hex", "0", "contiguous buffer", arg); + _PyArg_BadArgument("b2a_hex", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = binascii_b2a_hex_impl(module, &data); @@ -494,7 +494,7 @@ binascii_hexlify(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("hexlify", "0", "contiguous buffer", arg); + _PyArg_BadArgument("hexlify", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = binascii_hexlify_impl(module, &data); @@ -666,7 +666,7 @@ binascii_b2a_qp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_qp", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("b2a_qp", 1, "data", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -720,4 +720,4 @@ binascii_b2a_qp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj return return_value; } -/*[clinic end generated code: output=e588f90dd9417f46 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b75bfb58823158a5 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/grpmodule.c.h b/Modules/clinic/grpmodule.c.h index 8d46fbe8a50bfa..5debe35b2f32af 100644 --- a/Modules/clinic/grpmodule.c.h +++ b/Modules/clinic/grpmodule.c.h @@ -64,7 +64,7 @@ grp_getgrnam(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("getgrnam", "1", "str", args[0]); + _PyArg_BadArgument("getgrnam", 1, "name", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -97,4 +97,4 @@ grp_getgrall(PyObject *module, PyObject *Py_UNUSED(ignored)) { return grp_getgrall_impl(module); } -/*[clinic end generated code: output=07535b7468ff0486 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4a832b5d8c6c2bcb input=a9049054013a1b77]*/ diff --git a/Modules/clinic/itertoolsmodule.c.h b/Modules/clinic/itertoolsmodule.c.h index be52f5247d626b..9279c426227d8f 100644 --- a/Modules/clinic/itertoolsmodule.c.h +++ b/Modules/clinic/itertoolsmodule.c.h @@ -66,7 +66,7 @@ itertools__grouper(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyObject_TypeCheck(PyTuple_GET_ITEM(args, 0), &groupby_type)) { - _PyArg_BadArgument("_grouper", "1", (&groupby_type)->tp_name, PyTuple_GET_ITEM(args, 0)); + _PyArg_BadArgument("_grouper", 1, NULL, (&groupby_type)->tp_name, PyTuple_GET_ITEM(args, 0)); goto exit; } parent = PyTuple_GET_ITEM(args, 0); @@ -104,7 +104,7 @@ itertools_teedataobject(PyTypeObject *type, PyObject *args, PyObject *kwargs) } it = PyTuple_GET_ITEM(args, 0); if (!PyList_Check(PyTuple_GET_ITEM(args, 1))) { - _PyArg_BadArgument("teedataobject", "2", "list", PyTuple_GET_ITEM(args, 1)); + _PyArg_BadArgument("teedataobject", 2, NULL, "list", PyTuple_GET_ITEM(args, 1)); goto exit; } values = PyTuple_GET_ITEM(args, 1); @@ -642,4 +642,4 @@ itertools_count(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=127c01cc3ac5ab8d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8998dc0abf2edeeb input=a9049054013a1b77]*/ diff --git a/Modules/clinic/mathmodule.c.h b/Modules/clinic/mathmodule.c.h index f589e1c26becf9..22ae602adaec80 100644 --- a/Modules/clinic/mathmodule.c.h +++ b/Modules/clinic/mathmodule.c.h @@ -320,12 +320,12 @@ math_dist(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyTuple_Check(args[0])) { - _PyArg_BadArgument("dist", "1", "tuple", args[0]); + _PyArg_BadArgument("dist", 1, NULL, "tuple", args[0]); goto exit; } p = args[0]; if (!PyTuple_Check(args[1])) { - _PyArg_BadArgument("dist", "2", "tuple", args[1]); + _PyArg_BadArgument("dist", 2, NULL, "tuple", args[1]); goto exit; } q = args[1]; @@ -637,4 +637,4 @@ math_prod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k exit: return return_value; } -/*[clinic end generated code: output=3bcbaf1c1f729d06 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d3c6c5c698b5c656 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index f593b05d47762a..79efbde0606e6b 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -616,7 +616,7 @@ os_chflags(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * goto exit; } if (!PyLong_Check(args[1])) { - _PyArg_BadArgument("chflags", "2", "int", args[1]); + _PyArg_BadArgument("chflags", 2, "flags", "int", args[1]); goto exit; } flags = PyLong_AsUnsignedLongMask(args[1]); @@ -674,7 +674,7 @@ os_lchflags(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyLong_Check(args[1])) { - _PyArg_BadArgument("lchflags", "2", "int", args[1]); + _PyArg_BadArgument("lchflags", 2, "flags", "int", args[1]); goto exit; } flags = PyLong_AsUnsignedLongMask(args[1]); @@ -4969,7 +4969,7 @@ os_write(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("write", "2", "contiguous buffer", args[1]); + _PyArg_BadArgument("write", 2, NULL, "contiguous buffer", args[1]); goto exit; } _return_value = os_write_impl(module, fd, &data); @@ -5292,7 +5292,7 @@ os_pwrite(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("pwrite", "2", "contiguous buffer", args[1]); + _PyArg_BadArgument("pwrite", 2, NULL, "contiguous buffer", args[1]); goto exit; } if (!Py_off_t_converter(args[2], &offset)) { @@ -5923,7 +5923,7 @@ os_putenv(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("putenv", "1", "str", args[0]); + _PyArg_BadArgument("putenv", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -5931,7 +5931,7 @@ os_putenv(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } name = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("putenv", "2", "str", args[1]); + _PyArg_BadArgument("putenv", 2, NULL, "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -7127,7 +7127,7 @@ os_setxattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyBuffer_IsContiguous(&value, 'C')) { - _PyArg_BadArgument("setxattr", "3", "contiguous buffer", args[2]); + _PyArg_BadArgument("setxattr", 3, "value", "contiguous buffer", args[2]); goto exit; } if (!noptargs) { @@ -8576,4 +8576,4 @@ os__remove_dll_directory(PyObject *module, PyObject *const *args, Py_ssize_t nar #ifndef OS__REMOVE_DLL_DIRECTORY_METHODDEF #define OS__REMOVE_DLL_DIRECTORY_METHODDEF #endif /* !defined(OS__REMOVE_DLL_DIRECTORY_METHODDEF) */ -/*[clinic end generated code: output=d7bb4ce48171e64a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=22304a47e71b4d0b input=a9049054013a1b77]*/ diff --git a/Modules/clinic/pwdmodule.c.h b/Modules/clinic/pwdmodule.c.h index ab4f20d9fbda04..767de9f104a2d3 100644 --- a/Modules/clinic/pwdmodule.c.h +++ b/Modules/clinic/pwdmodule.c.h @@ -34,7 +34,7 @@ pwd_getpwnam(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("getpwnam", "0", "str", arg); + _PyArg_BadArgument("getpwnam", 0, NULL, "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -74,4 +74,4 @@ pwd_getpwall(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef PWD_GETPWALL_METHODDEF #define PWD_GETPWALL_METHODDEF #endif /* !defined(PWD_GETPWALL_METHODDEF) */ -/*[clinic end generated code: output=aae9a68994c7270f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b8499e2f717fe79a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/pyexpat.c.h b/Modules/clinic/pyexpat.c.h index 2428246a2f83b5..08f6d1eb39e7ab 100644 --- a/Modules/clinic/pyexpat.c.h +++ b/Modules/clinic/pyexpat.c.h @@ -75,7 +75,7 @@ pyexpat_xmlparser_SetBase(xmlparseobject *self, PyObject *arg) const char *base; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("SetBase", "0", "str", arg); + _PyArg_BadArgument("SetBase", 0, NULL, "str", arg); goto exit; } Py_ssize_t base_length; @@ -171,14 +171,14 @@ pyexpat_xmlparser_ExternalEntityParserCreate(xmlparseobject *self, PyObject *con } } else { - _PyArg_BadArgument("ExternalEntityParserCreate", "1", "str or None", args[0]); + _PyArg_BadArgument("ExternalEntityParserCreate", 1, NULL, "str or None", args[0]); goto exit; } if (nargs < 2) { goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("ExternalEntityParserCreate", "2", "str", args[1]); + _PyArg_BadArgument("ExternalEntityParserCreate", 2, NULL, "str", args[1]); goto exit; } Py_ssize_t encoding_length; @@ -327,7 +327,7 @@ pyexpat_ParserCreate(PyObject *module, PyObject *const *args, Py_ssize_t nargs, } } else { - _PyArg_BadArgument("ParserCreate", "1", "str or None", args[0]); + _PyArg_BadArgument("ParserCreate", 1, "encoding", "str or None", args[0]); goto exit; } if (!--noptargs) { @@ -350,7 +350,7 @@ pyexpat_ParserCreate(PyObject *module, PyObject *const *args, Py_ssize_t nargs, } } else { - _PyArg_BadArgument("ParserCreate", "2", "str or None", args[1]); + _PyArg_BadArgument("ParserCreate", 2, "namespace_separator", "str or None", args[1]); goto exit; } if (!--noptargs) { @@ -401,4 +401,4 @@ pyexpat_ErrorString(PyObject *module, PyObject *arg) #ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */ -/*[clinic end generated code: output=f85b6561bab73301 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ff349caaedfd9375 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/signalmodule.c.h b/Modules/clinic/signalmodule.c.h index c1028309218281..3bafdff83ce2db 100644 --- a/Modules/clinic/signalmodule.c.h +++ b/Modules/clinic/signalmodule.c.h @@ -590,7 +590,7 @@ signal_pthread_kill(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyLong_Check(args[0])) { - _PyArg_BadArgument("pthread_kill", "1", "int", args[0]); + _PyArg_BadArgument("pthread_kill", 1, NULL, "int", args[0]); goto exit; } thread_id = PyLong_AsUnsignedLongMask(args[0]); @@ -658,4 +658,4 @@ signal_pthread_kill(PyObject *module, PyObject *const *args, Py_ssize_t nargs) #ifndef SIGNAL_PTHREAD_KILL_METHODDEF #define SIGNAL_PTHREAD_KILL_METHODDEF #endif /* !defined(SIGNAL_PTHREAD_KILL_METHODDEF) */ -/*[clinic end generated code: output=00e33cc3cc3277f8 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9c989d16aadc9afb input=a9049054013a1b77]*/ diff --git a/Modules/clinic/spwdmodule.c.h b/Modules/clinic/spwdmodule.c.h index 1219ba859971af..c386e34cd4ae8a 100644 --- a/Modules/clinic/spwdmodule.c.h +++ b/Modules/clinic/spwdmodule.c.h @@ -25,7 +25,7 @@ spwd_getspnam(PyObject *module, PyObject *arg_) PyObject *arg; if (!PyUnicode_Check(arg_)) { - _PyArg_BadArgument("getspnam", "0", "str", arg_); + _PyArg_BadArgument("getspnam", 0, NULL, "str", arg_); goto exit; } if (PyUnicode_READY(arg_) == -1) { @@ -71,4 +71,4 @@ spwd_getspall(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef SPWD_GETSPALL_METHODDEF #define SPWD_GETSPALL_METHODDEF #endif /* !defined(SPWD_GETSPALL_METHODDEF) */ -/*[clinic end generated code: output=0d4d1a46591b2a15 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c7a506015f61bd90 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/symtablemodule.c.h b/Modules/clinic/symtablemodule.c.h index ff69d2d0262b5d..85a0334f23cd92 100644 --- a/Modules/clinic/symtablemodule.c.h +++ b/Modules/clinic/symtablemodule.c.h @@ -31,7 +31,7 @@ _symtable_symtable(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("symtable", "3", "str", args[2]); + _PyArg_BadArgument("symtable", 3, NULL, "str", args[2]); goto exit; } Py_ssize_t startstr_length; @@ -48,4 +48,4 @@ _symtable_symtable(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=97054c3d931cdce4 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f72e865ab32160db input=a9049054013a1b77]*/ diff --git a/Modules/clinic/unicodedata.c.h b/Modules/clinic/unicodedata.c.h index e018ea0b060e28..9cb51e59e8d010 100644 --- a/Modules/clinic/unicodedata.c.h +++ b/Modules/clinic/unicodedata.c.h @@ -30,14 +30,14 @@ unicodedata_UCD_decimal(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("decimal", "1", "a unicode character", args[0]); + _PyArg_BadArgument("decimal", 1, NULL, "a unicode character", args[0]); goto exit; } if (PyUnicode_READY(args[0])) { goto exit; } if (PyUnicode_GET_LENGTH(args[0]) != 1) { - _PyArg_BadArgument("decimal", "1", "a unicode character", args[0]); + _PyArg_BadArgument("decimal", 1, NULL, "a unicode character", args[0]); goto exit; } chr = PyUnicode_READ_CHAR(args[0], 0); @@ -79,14 +79,14 @@ unicodedata_UCD_digit(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("digit", "1", "a unicode character", args[0]); + _PyArg_BadArgument("digit", 1, NULL, "a unicode character", args[0]); goto exit; } if (PyUnicode_READY(args[0])) { goto exit; } if (PyUnicode_GET_LENGTH(args[0]) != 1) { - _PyArg_BadArgument("digit", "1", "a unicode character", args[0]); + _PyArg_BadArgument("digit", 1, NULL, "a unicode character", args[0]); goto exit; } chr = PyUnicode_READ_CHAR(args[0], 0); @@ -129,14 +129,14 @@ unicodedata_UCD_numeric(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("numeric", "1", "a unicode character", args[0]); + _PyArg_BadArgument("numeric", 1, NULL, "a unicode character", args[0]); goto exit; } if (PyUnicode_READY(args[0])) { goto exit; } if (PyUnicode_GET_LENGTH(args[0]) != 1) { - _PyArg_BadArgument("numeric", "1", "a unicode character", args[0]); + _PyArg_BadArgument("numeric", 1, NULL, "a unicode character", args[0]); goto exit; } chr = PyUnicode_READ_CHAR(args[0], 0); @@ -170,14 +170,14 @@ unicodedata_UCD_category(PyObject *self, PyObject *arg) int chr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("category", "0", "a unicode character", arg); + _PyArg_BadArgument("category", 0, NULL, "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("category", "0", "a unicode character", arg); + _PyArg_BadArgument("category", 0, NULL, "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -208,14 +208,14 @@ unicodedata_UCD_bidirectional(PyObject *self, PyObject *arg) int chr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("bidirectional", "0", "a unicode character", arg); + _PyArg_BadArgument("bidirectional", 0, NULL, "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("bidirectional", "0", "a unicode character", arg); + _PyArg_BadArgument("bidirectional", 0, NULL, "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -247,14 +247,14 @@ unicodedata_UCD_combining(PyObject *self, PyObject *arg) int _return_value; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("combining", "0", "a unicode character", arg); + _PyArg_BadArgument("combining", 0, NULL, "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("combining", "0", "a unicode character", arg); + _PyArg_BadArgument("combining", 0, NULL, "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -291,14 +291,14 @@ unicodedata_UCD_mirrored(PyObject *self, PyObject *arg) int _return_value; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("mirrored", "0", "a unicode character", arg); + _PyArg_BadArgument("mirrored", 0, NULL, "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("mirrored", "0", "a unicode character", arg); + _PyArg_BadArgument("mirrored", 0, NULL, "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -331,14 +331,14 @@ unicodedata_UCD_east_asian_width(PyObject *self, PyObject *arg) int chr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("east_asian_width", "0", "a unicode character", arg); + _PyArg_BadArgument("east_asian_width", 0, NULL, "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("east_asian_width", "0", "a unicode character", arg); + _PyArg_BadArgument("east_asian_width", 0, NULL, "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -369,14 +369,14 @@ unicodedata_UCD_decomposition(PyObject *self, PyObject *arg) int chr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("decomposition", "0", "a unicode character", arg); + _PyArg_BadArgument("decomposition", 0, NULL, "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("decomposition", "0", "a unicode character", arg); + _PyArg_BadArgument("decomposition", 0, NULL, "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -412,7 +412,7 @@ unicodedata_UCD_is_normalized(PyObject *self, PyObject *const *args, Py_ssize_t goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("is_normalized", "1", "str", args[0]); + _PyArg_BadArgument("is_normalized", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -420,7 +420,7 @@ unicodedata_UCD_is_normalized(PyObject *self, PyObject *const *args, Py_ssize_t } form = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("is_normalized", "2", "str", args[1]); + _PyArg_BadArgument("is_normalized", 2, NULL, "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -459,7 +459,7 @@ unicodedata_UCD_normalize(PyObject *self, PyObject *const *args, Py_ssize_t narg goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("normalize", "1", "str", args[0]); + _PyArg_BadArgument("normalize", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -467,7 +467,7 @@ unicodedata_UCD_normalize(PyObject *self, PyObject *const *args, Py_ssize_t narg } form = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("normalize", "2", "str", args[1]); + _PyArg_BadArgument("normalize", 2, NULL, "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -506,14 +506,14 @@ unicodedata_UCD_name(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("name", "1", "a unicode character", args[0]); + _PyArg_BadArgument("name", 1, NULL, "a unicode character", args[0]); goto exit; } if (PyUnicode_READY(args[0])) { goto exit; } if (PyUnicode_GET_LENGTH(args[0]) != 1) { - _PyArg_BadArgument("name", "1", "a unicode character", args[0]); + _PyArg_BadArgument("name", 1, NULL, "a unicode character", args[0]); goto exit; } chr = PyUnicode_READ_CHAR(args[0], 0); @@ -559,4 +559,4 @@ unicodedata_UCD_lookup(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=69adbc05d6796def input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4a9758579adebc95 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/zlibmodule.c.h b/Modules/clinic/zlibmodule.c.h index 1aa753ed7de0c9..41de47cfed2d51 100644 --- a/Modules/clinic/zlibmodule.c.h +++ b/Modules/clinic/zlibmodule.c.h @@ -38,7 +38,7 @@ zlib_compress(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("compress", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("compress", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -105,7 +105,7 @@ zlib_decompress(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("decompress", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("decompress", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -273,7 +273,7 @@ zlib_compressobj(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb goto exit; } if (!PyBuffer_IsContiguous(&zdict, 'C')) { - _PyArg_BadArgument("compressobj", "6", "contiguous buffer", args[5]); + _PyArg_BadArgument("compressobj", 6, "zdict", "contiguous buffer", args[5]); goto exit; } skip_optional_pos: @@ -375,7 +375,7 @@ zlib_Compress_compress(compobject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("compress", "0", "contiguous buffer", arg); + _PyArg_BadArgument("compress", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = zlib_Compress_compress_impl(self, &data); @@ -432,7 +432,7 @@ zlib_Decompress_decompress(compobject *self, PyObject *const *args, Py_ssize_t n goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("decompress", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("decompress", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -677,7 +677,7 @@ zlib_adler32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("adler32", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("adler32", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -735,7 +735,7 @@ zlib_crc32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("crc32", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("crc32", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -785,4 +785,4 @@ zlib_crc32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) #ifndef ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF #define ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF #endif /* !defined(ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF) */ -/*[clinic end generated code: output=b2ce5de6c650004c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d0bfacbb4ce266fa input=a9049054013a1b77]*/ diff --git a/Objects/clinic/bytearrayobject.c.h b/Objects/clinic/bytearrayobject.c.h index 7dd1f88b47edb8..10e2bceb9fea2b 100644 --- a/Objects/clinic/bytearrayobject.c.h +++ b/Objects/clinic/bytearrayobject.c.h @@ -115,14 +115,14 @@ bytearray_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&frm, 'C')) { - _PyArg_BadArgument("maketrans", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("maketrans", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &to, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&to, 'C')) { - _PyArg_BadArgument("maketrans", "2", "contiguous buffer", args[1]); + _PyArg_BadArgument("maketrans", 2, NULL, "contiguous buffer", args[1]); goto exit; } return_value = bytearray_maketrans_impl(&frm, &to); @@ -175,14 +175,14 @@ bytearray_replace(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&old, 'C')) { - _PyArg_BadArgument("replace", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("replace", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &new, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&new, 'C')) { - _PyArg_BadArgument("replace", "2", "contiguous buffer", args[1]); + _PyArg_BadArgument("replace", 2, NULL, "contiguous buffer", args[1]); goto exit; } if (nargs < 3) { @@ -735,7 +735,7 @@ bytearray_decode(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t narg } if (args[0]) { if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("decode", "1", "str", args[0]); + _PyArg_BadArgument("decode", 1, "encoding", "str", args[0]); goto exit; } Py_ssize_t encoding_length; @@ -752,7 +752,7 @@ bytearray_decode(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t narg } } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("decode", "2", "str", args[1]); + _PyArg_BadArgument("decode", 2, "errors", "str", args[1]); goto exit; } Py_ssize_t errors_length; @@ -854,7 +854,7 @@ bytearray_fromhex(PyTypeObject *type, PyObject *arg) PyObject *string; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("fromhex", "0", "str", arg); + _PyArg_BadArgument("fromhex", 0, NULL, "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -942,4 +942,4 @@ bytearray_sizeof(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored)) { return bytearray_sizeof_impl(self); } -/*[clinic end generated code: output=16387cbb8b23fbc2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=05e4e168c88d7565 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/bytesobject.c.h b/Objects/clinic/bytesobject.c.h index 590d82f4cbc558..9987a895652e08 100644 --- a/Objects/clinic/bytesobject.c.h +++ b/Objects/clinic/bytesobject.c.h @@ -99,7 +99,7 @@ bytes_partition(PyBytesObject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&sep, 'C')) { - _PyArg_BadArgument("partition", "0", "contiguous buffer", arg); + _PyArg_BadArgument("partition", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = bytes_partition_impl(self, &sep); @@ -142,7 +142,7 @@ bytes_rpartition(PyBytesObject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&sep, 'C')) { - _PyArg_BadArgument("rpartition", "0", "contiguous buffer", arg); + _PyArg_BadArgument("rpartition", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = bytes_rpartition_impl(self, &sep); @@ -420,14 +420,14 @@ bytes_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&frm, 'C')) { - _PyArg_BadArgument("maketrans", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("maketrans", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &to, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&to, 'C')) { - _PyArg_BadArgument("maketrans", "2", "contiguous buffer", args[1]); + _PyArg_BadArgument("maketrans", 2, NULL, "contiguous buffer", args[1]); goto exit; } return_value = bytes_maketrans_impl(&frm, &to); @@ -480,14 +480,14 @@ bytes_replace(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&old, 'C')) { - _PyArg_BadArgument("replace", "1", "contiguous buffer", args[0]); + _PyArg_BadArgument("replace", 1, NULL, "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &new, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&new, 'C')) { - _PyArg_BadArgument("replace", "2", "contiguous buffer", args[1]); + _PyArg_BadArgument("replace", 2, NULL, "contiguous buffer", args[1]); goto exit; } if (nargs < 3) { @@ -568,7 +568,7 @@ bytes_decode(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObj } if (args[0]) { if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("decode", "1", "str", args[0]); + _PyArg_BadArgument("decode", 1, "encoding", "str", args[0]); goto exit; } Py_ssize_t encoding_length; @@ -585,7 +585,7 @@ bytes_decode(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObj } } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("decode", "2", "str", args[1]); + _PyArg_BadArgument("decode", 2, "errors", "str", args[1]); goto exit; } Py_ssize_t errors_length; @@ -674,7 +674,7 @@ bytes_fromhex(PyTypeObject *type, PyObject *arg) PyObject *string; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("fromhex", "0", "str", arg); + _PyArg_BadArgument("fromhex", 0, NULL, "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -686,4 +686,4 @@ bytes_fromhex(PyTypeObject *type, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=88b6905912e52b93 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=852535b3ae0b8cdb input=a9049054013a1b77]*/ diff --git a/Objects/clinic/codeobject.c.h b/Objects/clinic/codeobject.c.h index 0761f9aa707c8f..6c26732bd48667 100644 --- a/Objects/clinic/codeobject.c.h +++ b/Objects/clinic/codeobject.c.h @@ -158,7 +158,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[7]) { if (!PyBytes_Check(args[7])) { - _PyArg_BadArgument("replace", "'co_code'", "bytes", args[7]); + _PyArg_BadArgument("replace", 8, "co_code", "bytes", args[7]); goto exit; } co_code = (PyBytesObject *)args[7]; @@ -168,7 +168,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[8]) { if (!PyTuple_Check(args[8])) { - _PyArg_BadArgument("replace", "'co_consts'", "tuple", args[8]); + _PyArg_BadArgument("replace", 9, "co_consts", "tuple", args[8]); goto exit; } co_consts = args[8]; @@ -178,7 +178,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[9]) { if (!PyTuple_Check(args[9])) { - _PyArg_BadArgument("replace", "'co_names'", "tuple", args[9]); + _PyArg_BadArgument("replace", 10, "co_names", "tuple", args[9]); goto exit; } co_names = args[9]; @@ -188,7 +188,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[10]) { if (!PyTuple_Check(args[10])) { - _PyArg_BadArgument("replace", "'co_varnames'", "tuple", args[10]); + _PyArg_BadArgument("replace", 11, "co_varnames", "tuple", args[10]); goto exit; } co_varnames = args[10]; @@ -198,7 +198,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[11]) { if (!PyTuple_Check(args[11])) { - _PyArg_BadArgument("replace", "'co_freevars'", "tuple", args[11]); + _PyArg_BadArgument("replace", 12, "co_freevars", "tuple", args[11]); goto exit; } co_freevars = args[11]; @@ -208,7 +208,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[12]) { if (!PyTuple_Check(args[12])) { - _PyArg_BadArgument("replace", "'co_cellvars'", "tuple", args[12]); + _PyArg_BadArgument("replace", 13, "co_cellvars", "tuple", args[12]); goto exit; } co_cellvars = args[12]; @@ -218,7 +218,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[13]) { if (!PyUnicode_Check(args[13])) { - _PyArg_BadArgument("replace", "'co_filename'", "str", args[13]); + _PyArg_BadArgument("replace", 14, "co_filename", "str", args[13]); goto exit; } if (PyUnicode_READY(args[13]) == -1) { @@ -231,7 +231,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[14]) { if (!PyUnicode_Check(args[14])) { - _PyArg_BadArgument("replace", "'co_name'", "str", args[14]); + _PyArg_BadArgument("replace", 15, "co_name", "str", args[14]); goto exit; } if (PyUnicode_READY(args[14]) == -1) { @@ -243,7 +243,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } } if (!PyBytes_Check(args[15])) { - _PyArg_BadArgument("replace", "'co_lnotab'", "bytes", args[15]); + _PyArg_BadArgument("replace", 16, "co_lnotab", "bytes", args[15]); goto exit; } co_lnotab = (PyBytesObject *)args[15]; @@ -253,4 +253,4 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje exit: return return_value; } -/*[clinic end generated code: output=42e00fc97bcf657b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a9c21d66b7513a60 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/floatobject.c.h b/Objects/clinic/floatobject.c.h index 82bcde2f4c2401..9bea9f403ad523 100644 --- a/Objects/clinic/floatobject.c.h +++ b/Objects/clinic/floatobject.c.h @@ -235,7 +235,7 @@ float___getformat__(PyTypeObject *type, PyObject *arg) const char *typestr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__getformat__", "0", "str", arg); + _PyArg_BadArgument("__getformat__", 0, NULL, "str", arg); goto exit; } Py_ssize_t typestr_length; @@ -289,7 +289,7 @@ float___set_format__(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("__set_format__", "1", "str", args[0]); + _PyArg_BadArgument("__set_format__", 1, NULL, "str", args[0]); goto exit; } Py_ssize_t typestr_length; @@ -302,7 +302,7 @@ float___set_format__(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("__set_format__", "2", "str", args[1]); + _PyArg_BadArgument("__set_format__", 2, NULL, "str", args[1]); goto exit; } Py_ssize_t fmt_length; @@ -339,7 +339,7 @@ float___format__(PyObject *self, PyObject *arg) PyObject *format_spec; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__format__", "0", "str", arg); + _PyArg_BadArgument("__format__", 0, NULL, "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -351,4 +351,4 @@ float___format__(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=eff900d4dec282e3 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=84b2b5cd8178e797 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/funcobject.c.h b/Objects/clinic/funcobject.c.h index 530e9c769c95a9..8ccf9a60a790f8 100644 --- a/Objects/clinic/funcobject.c.h +++ b/Objects/clinic/funcobject.c.h @@ -44,12 +44,12 @@ func_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyObject_TypeCheck(fastargs[0], &PyCode_Type)) { - _PyArg_BadArgument("function", "1", (&PyCode_Type)->tp_name, fastargs[0]); + _PyArg_BadArgument("function", 1, "code", (&PyCode_Type)->tp_name, fastargs[0]); goto exit; } code = (PyCodeObject *)fastargs[0]; if (!PyDict_Check(fastargs[1])) { - _PyArg_BadArgument("function", "2", "dict", fastargs[1]); + _PyArg_BadArgument("function", 2, "globals", "dict", fastargs[1]); goto exit; } globals = fastargs[1]; @@ -75,4 +75,4 @@ func_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=9a4d09e5f261161d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3c5859ec33df1021 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/longobject.c.h b/Objects/clinic/longobject.c.h index fa32c3588f913d..bc03c907addcb3 100644 --- a/Objects/clinic/longobject.c.h +++ b/Objects/clinic/longobject.c.h @@ -74,7 +74,7 @@ int___format__(PyObject *self, PyObject *arg) PyObject *format_spec; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__format__", "0", "str", arg); + _PyArg_BadArgument("__format__", 0, NULL, "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -227,7 +227,7 @@ int_to_bytes(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject * length = ival; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("to_bytes", "2", "str", args[1]); + _PyArg_BadArgument("to_bytes", 2, "byteorder", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -293,7 +293,7 @@ int_from_bytes(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs, PyOb } bytes_obj = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("from_bytes", "2", "str", args[1]); + _PyArg_BadArgument("from_bytes", 2, "byteorder", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -313,4 +313,4 @@ int_from_bytes(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs, PyOb exit: return return_value; } -/*[clinic end generated code: output=4b43f543f581a14f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6b27b1f015ff54d5 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/moduleobject.c.h b/Objects/clinic/moduleobject.c.h index 8effaa39d870d0..ebb891bc0f3be8 100644 --- a/Objects/clinic/moduleobject.c.h +++ b/Objects/clinic/moduleobject.c.h @@ -31,7 +31,7 @@ module___init__(PyObject *self, PyObject *args, PyObject *kwargs) goto exit; } if (!PyUnicode_Check(fastargs[0])) { - _PyArg_BadArgument("module", "1", "str", fastargs[0]); + _PyArg_BadArgument("module", 1, "name", "str", fastargs[0]); goto exit; } if (PyUnicode_READY(fastargs[0]) == -1) { @@ -48,4 +48,4 @@ module___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=dfd4f10143cfe989 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9b65f8ef68a2932e input=a9049054013a1b77]*/ diff --git a/Objects/clinic/typeobject.c.h b/Objects/clinic/typeobject.c.h index 865df4d4945df9..c64f68eefefc76 100644 --- a/Objects/clinic/typeobject.c.h +++ b/Objects/clinic/typeobject.c.h @@ -200,7 +200,7 @@ object___format__(PyObject *self, PyObject *arg) PyObject *format_spec; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__format__", "0", "str", arg); + _PyArg_BadArgument("__format__", 0, NULL, "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -248,4 +248,4 @@ object___dir__(PyObject *self, PyObject *Py_UNUSED(ignored)) { return object___dir___impl(self); } -/*[clinic end generated code: output=926ed3341450acda input=a9049054013a1b77]*/ +/*[clinic end generated code: output=bb04310c1ce00d90 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/unicodeobject.c.h b/Objects/clinic/unicodeobject.c.h index a0d040f02b6913..33cba3ec11a07a 100644 --- a/Objects/clinic/unicodeobject.c.h +++ b/Objects/clinic/unicodeobject.c.h @@ -157,7 +157,7 @@ unicode_encode(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject } if (args[0]) { if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("encode", "1", "str", args[0]); + _PyArg_BadArgument("encode", 1, "encoding", "str", args[0]); goto exit; } Py_ssize_t encoding_length; @@ -174,7 +174,7 @@ unicode_encode(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject } } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("encode", "2", "str", args[1]); + _PyArg_BadArgument("encode", 2, "errors", "str", args[1]); goto exit; } Py_ssize_t errors_length; @@ -712,7 +712,7 @@ unicode_replace(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("replace", "1", "str", args[0]); + _PyArg_BadArgument("replace", 1, NULL, "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -720,7 +720,7 @@ unicode_replace(PyObject *self, PyObject *const *args, Py_ssize_t nargs) } old = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("replace", "2", "str", args[1]); + _PyArg_BadArgument("replace", 2, NULL, "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -1080,7 +1080,7 @@ unicode_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("maketrans", "2", "str", args[1]); + _PyArg_BadArgument("maketrans", 2, NULL, "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -1091,7 +1091,7 @@ unicode_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("maketrans", "3", "str", args[2]); + _PyArg_BadArgument("maketrans", 3, NULL, "str", args[2]); goto exit; } if (PyUnicode_READY(args[2]) == -1) { @@ -1202,7 +1202,7 @@ unicode___format__(PyObject *self, PyObject *arg) PyObject *format_spec; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__format__", "0", "str", arg); + _PyArg_BadArgument("__format__", 0, NULL, "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -1232,4 +1232,4 @@ unicode_sizeof(PyObject *self, PyObject *Py_UNUSED(ignored)) { return unicode_sizeof_impl(self); } -/*[clinic end generated code: output=9640feea5455211b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1614a54b592397f6 input=a9049054013a1b77]*/ diff --git a/Objects/stringlib/clinic/transmogrify.h.h b/Objects/stringlib/clinic/transmogrify.h.h index b2e95ab8afba5e..4bc21a161a8af8 100644 --- a/Objects/stringlib/clinic/transmogrify.h.h +++ b/Objects/stringlib/clinic/transmogrify.h.h @@ -100,7 +100,7 @@ stringlib_ljust(PyObject *self, PyObject *const *args, Py_ssize_t nargs) fillchar = PyByteArray_AS_STRING(args[1])[0]; } else { - _PyArg_BadArgument("ljust", "2", "a byte string of length 1", args[1]); + _PyArg_BadArgument("ljust", 2, NULL, "a byte string of length 1", args[1]); goto exit; } skip_optional: @@ -161,7 +161,7 @@ stringlib_rjust(PyObject *self, PyObject *const *args, Py_ssize_t nargs) fillchar = PyByteArray_AS_STRING(args[1])[0]; } else { - _PyArg_BadArgument("rjust", "2", "a byte string of length 1", args[1]); + _PyArg_BadArgument("rjust", 2, NULL, "a byte string of length 1", args[1]); goto exit; } skip_optional: @@ -222,7 +222,7 @@ stringlib_center(PyObject *self, PyObject *const *args, Py_ssize_t nargs) fillchar = PyByteArray_AS_STRING(args[1])[0]; } else { - _PyArg_BadArgument("center", "2", "a byte string of length 1", args[1]); + _PyArg_BadArgument("center", 2, NULL, "a byte string of length 1", args[1]); goto exit; } skip_optional: @@ -274,4 +274,4 @@ stringlib_zfill(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=7a8bdc0fb59e99eb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c416ebfb732f8184 input=a9049054013a1b77]*/ diff --git a/PC/clinic/_testconsole.c.h b/PC/clinic/_testconsole.c.h index 739ca75194d87a..63f580c0bf963c 100644 --- a/PC/clinic/_testconsole.c.h +++ b/PC/clinic/_testconsole.c.h @@ -33,7 +33,7 @@ _testconsole_write_input(PyObject *module, PyObject *const *args, Py_ssize_t nar } file = args[0]; if (!PyBytes_Check(args[1])) { - _PyArg_BadArgument("write_input", "2", "bytes", args[1]); + _PyArg_BadArgument("write_input", 2, "s", "bytes", args[1]); goto exit; } s = (PyBytesObject *)args[1]; @@ -88,4 +88,4 @@ _testconsole_read_output(PyObject *module, PyObject *const *args, Py_ssize_t nar #ifndef _TESTCONSOLE_READ_OUTPUT_METHODDEF #define _TESTCONSOLE_READ_OUTPUT_METHODDEF #endif /* !defined(_TESTCONSOLE_READ_OUTPUT_METHODDEF) */ -/*[clinic end generated code: output=92f624ac54ce33ff input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ccf0c449053656a6 input=a9049054013a1b77]*/ diff --git a/PC/clinic/msvcrtmodule.c.h b/PC/clinic/msvcrtmodule.c.h index fd4f034e30ffa0..ac64a177dcd1db 100644 --- a/PC/clinic/msvcrtmodule.c.h +++ b/PC/clinic/msvcrtmodule.c.h @@ -375,7 +375,7 @@ msvcrt_putch(PyObject *module, PyObject *arg) char_value = PyByteArray_AS_STRING(arg)[0]; } else { - _PyArg_BadArgument("putch", "0", "a byte string of length 1", arg); + _PyArg_BadArgument("putch", 0, NULL, "a byte string of length 1", arg); goto exit; } return_value = msvcrt_putch_impl(module, char_value); @@ -403,14 +403,14 @@ msvcrt_putwch(PyObject *module, PyObject *arg) int unicode_char; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("putwch", "0", "a unicode character", arg); + _PyArg_BadArgument("putwch", 0, NULL, "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("putwch", "0", "a unicode character", arg); + _PyArg_BadArgument("putwch", 0, NULL, "a unicode character", arg); goto exit; } unicode_char = PyUnicode_READ_CHAR(arg, 0); @@ -449,7 +449,7 @@ msvcrt_ungetch(PyObject *module, PyObject *arg) char_value = PyByteArray_AS_STRING(arg)[0]; } else { - _PyArg_BadArgument("ungetch", "0", "a byte string of length 1", arg); + _PyArg_BadArgument("ungetch", 0, NULL, "a byte string of length 1", arg); goto exit; } return_value = msvcrt_ungetch_impl(module, char_value); @@ -477,14 +477,14 @@ msvcrt_ungetwch(PyObject *module, PyObject *arg) int unicode_char; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("ungetwch", "0", "a unicode character", arg); + _PyArg_BadArgument("ungetwch", 0, NULL, "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("ungetwch", "0", "a unicode character", arg); + _PyArg_BadArgument("ungetwch", 0, NULL, "a unicode character", arg); goto exit; } unicode_char = PyUnicode_READ_CHAR(arg, 0); @@ -679,4 +679,4 @@ msvcrt_SetErrorMode(PyObject *module, PyObject *arg) #ifndef MSVCRT_SET_ERROR_MODE_METHODDEF #define MSVCRT_SET_ERROR_MODE_METHODDEF #endif /* !defined(MSVCRT_SET_ERROR_MODE_METHODDEF) */ -/*[clinic end generated code: output=e222ca1443153a37 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e4d2e881b8cf0de7 input=a9049054013a1b77]*/ diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h index dc8b0f3b1f310a..5354166abfff18 100644 --- a/Python/clinic/bltinmodule.c.h +++ b/Python/clinic/bltinmodule.c.h @@ -102,7 +102,7 @@ builtin_format(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("format", "2", "str", args[1]); + _PyArg_BadArgument("format", 2, NULL, "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -200,7 +200,7 @@ builtin_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("compile", "3", "str", args[2]); + _PyArg_BadArgument("compile", 3, "mode", "str", args[2]); goto exit; } Py_ssize_t mode_length; @@ -845,4 +845,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=c4709b74364f9aa7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=183d8cbb521432fe input=a9049054013a1b77]*/ diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h index 34020991abbf5c..1731235dff9e3e 100644 --- a/Python/clinic/import.c.h +++ b/Python/clinic/import.c.h @@ -92,12 +92,12 @@ _imp__fix_co_filename(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyObject_TypeCheck(args[0], &PyCode_Type)) { - _PyArg_BadArgument("_fix_co_filename", "1", (&PyCode_Type)->tp_name, args[0]); + _PyArg_BadArgument("_fix_co_filename", 1, NULL, (&PyCode_Type)->tp_name, args[0]); goto exit; } code = (PyCodeObject *)args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("_fix_co_filename", "2", "str", args[1]); + _PyArg_BadArgument("_fix_co_filename", 2, NULL, "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -156,7 +156,7 @@ _imp_init_frozen(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("init_frozen", "0", "str", arg); + _PyArg_BadArgument("init_frozen", 0, NULL, "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -188,7 +188,7 @@ _imp_get_frozen_object(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("get_frozen_object", "0", "str", arg); + _PyArg_BadArgument("get_frozen_object", 0, NULL, "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -220,7 +220,7 @@ _imp_is_frozen_package(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("is_frozen_package", "0", "str", arg); + _PyArg_BadArgument("is_frozen_package", 0, NULL, "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -252,7 +252,7 @@ _imp_is_builtin(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("is_builtin", "0", "str", arg); + _PyArg_BadArgument("is_builtin", 0, NULL, "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -284,7 +284,7 @@ _imp_is_frozen(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("is_frozen", "0", "str", arg); + _PyArg_BadArgument("is_frozen", 0, NULL, "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -433,7 +433,7 @@ _imp_source_hash(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb goto exit; } if (!PyBuffer_IsContiguous(&source, 'C')) { - _PyArg_BadArgument("source_hash", "2", "contiguous buffer", args[1]); + _PyArg_BadArgument("source_hash", 2, "source", "contiguous buffer", args[1]); goto exit; } return_value = _imp_source_hash_impl(module, key, &source); @@ -454,4 +454,4 @@ _imp_source_hash(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #ifndef _IMP_EXEC_DYNAMIC_METHODDEF #define _IMP_EXEC_DYNAMIC_METHODDEF #endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */ -/*[clinic end generated code: output=da2bfe8965a2c54b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d1baf0a8f43bf0c2 input=a9049054013a1b77]*/ diff --git a/Python/clinic/marshal.c.h b/Python/clinic/marshal.c.h index f52c263e8ebe87..cc372cf7106884 100644 --- a/Python/clinic/marshal.c.h +++ b/Python/clinic/marshal.c.h @@ -152,7 +152,7 @@ marshal_loads(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&bytes, 'C')) { - _PyArg_BadArgument("loads", "0", "contiguous buffer", arg); + _PyArg_BadArgument("loads", 0, NULL, "contiguous buffer", arg); goto exit; } return_value = marshal_loads_impl(module, &bytes); @@ -165,4 +165,4 @@ marshal_loads(PyObject *module, PyObject *arg) return return_value; } -/*[clinic end generated code: output=547a6a9e7afdd98a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=92cf7faf9b57dbae input=a9049054013a1b77]*/ diff --git a/Python/clinic/sysmodule.c.h b/Python/clinic/sysmodule.c.h index aae3f65d8f4460..971f88bc2395f3 100644 --- a/Python/clinic/sysmodule.c.h +++ b/Python/clinic/sysmodule.c.h @@ -228,7 +228,7 @@ sys_intern(PyObject *module, PyObject *arg) PyObject *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("intern", "0", "str", arg); + _PyArg_BadArgument("intern", 0, NULL, "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -925,7 +925,7 @@ sys_call_tracing(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } func = args[0]; if (!PyTuple_Check(args[1])) { - _PyArg_BadArgument("call_tracing", "2", "tuple", args[1]); + _PyArg_BadArgument("call_tracing", 2, NULL, "tuple", args[1]); goto exit; } funcargs = args[1]; @@ -1082,4 +1082,4 @@ sys_getandroidapilevel(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef SYS_GETANDROIDAPILEVEL_METHODDEF #define SYS_GETANDROIDAPILEVEL_METHODDEF #endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */ -/*[clinic end generated code: output=f9ee8b61cf5c3802 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=223863edf9d0e4d9 input=a9049054013a1b77]*/ diff --git a/Python/clinic/traceback.c.h b/Python/clinic/traceback.c.h index b549d0d25c466d..64eea1e6f3dab1 100644 --- a/Python/clinic/traceback.c.h +++ b/Python/clinic/traceback.c.h @@ -32,7 +32,7 @@ tb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) } tb_next = fastargs[0]; if (!PyObject_TypeCheck(fastargs[1], &PyFrame_Type)) { - _PyArg_BadArgument("TracebackType", "2", (&PyFrame_Type)->tp_name, fastargs[1]); + _PyArg_BadArgument("TracebackType", 2, "tb_frame", (&PyFrame_Type)->tp_name, fastargs[1]); goto exit; } tb_frame = (PyFrameObject *)fastargs[1]; @@ -59,4 +59,4 @@ tb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=e2d163d7f25a6770 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e636e37c29947c87 input=a9049054013a1b77]*/ diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 7cb589c211ce51..42ad383259ff50 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -1733,7 +1733,7 @@ def dump(self): # "languages" maps the name of the language ("C", "Python"). # "extensions" maps the file extension ("c", "py"). languages = { 'C': CLanguage, 'Python': PythonLanguage } -extensions = { name: CLanguage for name in "c cc cpp cxx h hh hpp hxx".split() } +extensions = { name: CLanguage for name in "c cc cpp cxx h hh hpp hxx test".split() } extensions['py'] = PythonLanguage @@ -3350,7 +3350,7 @@ def parse_arg(self, argname, argnum, displayname): }}}} {paramname} = ({type}){argname}; """.format(argname=argname, paramname=self.name, argnum=argnum, - type=self.type) + type=self.type, displayname=displayname) return super().parse_arg(argname, argnum, displayname) class unicode_converter(CConverter): From 749ddeaeaae5d75454983455af55808159b72629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Lapeyre?= Date: Wed, 29 May 2019 15:04:32 +0200 Subject: [PATCH 07/15] Fix test_pyexpat --- Lib/test/test_pyexpat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_pyexpat.py b/Lib/test/test_pyexpat.py index 92fffc45f30a96..2b6c2d20e74612 100644 --- a/Lib/test/test_pyexpat.py +++ b/Lib/test/test_pyexpat.py @@ -285,7 +285,7 @@ def test_illegal(self): self.fail() except TypeError as e: self.assertEqual(str(e), - 'ParserCreate() argument 2 must be str or None, not int') + "ParserCreate() argument 'namespace_separator' must be str or None, not int") try: expat.ParserCreate(namespace_separator='too long') From 0db10bb64217d3b096d09ec6662e339d81dad8db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Lapeyre?= Date: Sat, 8 Jun 2019 16:42:37 +0200 Subject: [PATCH 08/15] Remove test from the clinic file extensions --- Tools/clinic/clinic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 42ad383259ff50..b50ebb32527a0d 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -1733,7 +1733,7 @@ def dump(self): # "languages" maps the name of the language ("C", "Python"). # "extensions" maps the file extension ("c", "py"). languages = { 'C': CLanguage, 'Python': PythonLanguage } -extensions = { name: CLanguage for name in "c cc cpp cxx h hh hpp hxx test".split() } +extensions = { name: CLanguage for name in "c cc cpp cxx h hh hpp hxx".split() } extensions['py'] = PythonLanguage From 65b615fb390dc7ec03e02e0f7b061913c0958f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Lapeyre?= Date: Sat, 8 Jun 2019 16:46:14 +0200 Subject: [PATCH 09/15] Remove f-string --- Tools/clinic/clinic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index b50ebb32527a0d..f523ca0f9dcfa9 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -2298,7 +2298,7 @@ def copy(self, **overrides): def displayname(self): if self.is_positional_or_keyword(): - return f'"{self.name}"' + return '"{}"'.format(self.name) else: return 'NULL' From 1333e214e89a14010768e81479a8af38191e19f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Lapeyre?= Date: Sat, 8 Jun 2019 16:48:34 +0200 Subject: [PATCH 10/15] Add comment regarding argname encoding --- Python/getargs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Python/getargs.c b/Python/getargs.c index 6a656403a311d0..344a7eafb45530 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -610,7 +610,9 @@ convertitem(PyObject *arg, const char **p_format, va_list *p_va, int flags, -/* Format an error message generated by convertsimple(). */ +/* Format an error message generated by convertsimple(). + argname must be UTF-8 encodeded. +*/ void _PyArg_BadArgument(const char *fname, int iarg, const char *argname, From 056c45bb28025c30e35128d819d8c6a4126fc65e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Lapeyre?= Date: Tue, 11 Jun 2019 11:58:10 +0200 Subject: [PATCH 11/15] Put back error message for single argument --- Python/getargs.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Python/getargs.c b/Python/getargs.c index 344a7eafb45530..20c6b6f30a9a59 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -618,16 +618,23 @@ void _PyArg_BadArgument(const char *fname, int iarg, const char *argname, const char *expected, PyObject *arg) { - if (argname) { - PyErr_Format(PyExc_TypeError, - "%.200s() argument '%.200s' must be %.50s, not %.50s", - fname, argname, expected, - arg == Py_None ? "None" : arg->ob_type->tp_name); + if (iarg) { + if (argname) { + PyErr_Format(PyExc_TypeError, + "%.200s() argument '%.200s' must be %.50s, not %.50s", + fname, argname, expected, + arg == Py_None ? "None" : arg->ob_type->tp_name); + } else { + PyErr_Format(PyExc_TypeError, + "%.200s() argument %d must be %.50s, not %.50s", + fname, iarg, expected, + arg == Py_None ? "None" : arg->ob_type->tp_name); + } } else { PyErr_Format(PyExc_TypeError, - "%.200s() argument %d must be %.50s, not %.50s", - fname, iarg, expected, - arg == Py_None ? "None" : arg->ob_type->tp_name); + "%.200s() argument must be %.50s, not %.50s", + fname, expected, + arg == Py_None ? "None" : arg->ob_type->tp_name); } } From 2690318d46ad5d777c7d31a48f9dd634a5aa5bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Lapeyre?= Date: Tue, 11 Jun 2019 12:26:25 +0200 Subject: [PATCH 12/15] Simplify _PyArg_BadArgument --- Modules/_blake2/clinic/blake2b_impl.c.h | 8 +- Modules/_blake2/clinic/blake2s_impl.c.h | 8 +- Modules/_io/clinic/_iomodule.c.h | 12 +- Modules/_io/clinic/bufferedio.c.h | 20 +-- Modules/_io/clinic/bytesio.c.h | 6 +- Modules/_io/clinic/fileio.c.h | 10 +- Modules/_io/clinic/textio.c.h | 8 +- Modules/_io/clinic/winconsoleio.c.h | 10 +- .../_multiprocessing/clinic/posixshmem.c.h | 6 +- Modules/cjkcodecs/clinic/multibytecodec.c.h | 14 +- Modules/clinic/_bz2module.c.h | 6 +- Modules/clinic/_codecsmodule.c.h | 168 +++++++++--------- Modules/clinic/_cryptmodule.c.h | 6 +- Modules/clinic/_curses_panel.c.h | 6 +- Modules/clinic/_cursesmodule.c.h | 14 +- Modules/clinic/_dbmmodule.c.h | 6 +- Modules/clinic/_elementtree.c.h | 12 +- Modules/clinic/_gdbmmodule.c.h | 6 +- Modules/clinic/_hashopenssl.c.h | 24 +-- Modules/clinic/_lzmamodule.c.h | 8 +- Modules/clinic/_pickle.c.h | 14 +- Modules/clinic/_sre.c.h | 8 +- Modules/clinic/_ssl.c.h | 28 +-- Modules/clinic/_struct.c.h | 10 +- Modules/clinic/_tkinter.c.h | 30 ++-- Modules/clinic/_weakref.c.h | 4 +- Modules/clinic/arraymodule.c.h | 10 +- Modules/clinic/audioop.c.h | 60 +++---- Modules/clinic/binascii.c.h | 22 +-- Modules/clinic/grpmodule.c.h | 4 +- Modules/clinic/itertoolsmodule.c.h | 6 +- Modules/clinic/mathmodule.c.h | 6 +- Modules/clinic/posixmodule.c.h | 16 +- Modules/clinic/pwdmodule.c.h | 4 +- Modules/clinic/pyexpat.c.h | 12 +- Modules/clinic/signalmodule.c.h | 4 +- Modules/clinic/spwdmodule.c.h | 4 +- Modules/clinic/symtablemodule.c.h | 4 +- Modules/clinic/unicodedata.c.h | 50 +++--- Modules/clinic/zlibmodule.c.h | 16 +- Objects/clinic/bytearrayobject.c.h | 16 +- Objects/clinic/bytesobject.c.h | 20 +-- Objects/clinic/codeobject.c.h | 20 +-- Objects/clinic/floatobject.c.h | 10 +- Objects/clinic/funcobject.c.h | 6 +- Objects/clinic/longobject.c.h | 8 +- Objects/clinic/moduleobject.c.h | 4 +- Objects/clinic/typeobject.c.h | 4 +- Objects/clinic/unicodeobject.c.h | 16 +- Objects/stringlib/clinic/transmogrify.h.h | 8 +- PC/clinic/_testconsole.c.h | 4 +- PC/clinic/msvcrtmodule.c.h | 14 +- Python/clinic/bltinmodule.c.h | 6 +- Python/clinic/import.c.h | 18 +- Python/clinic/marshal.c.h | 4 +- Python/clinic/sysmodule.c.h | 6 +- Python/clinic/traceback.c.h | 4 +- Python/getargs.c | 26 +-- Tools/clinic/clinic.py | 14 +- 59 files changed, 433 insertions(+), 445 deletions(-) diff --git a/Modules/_blake2/clinic/blake2b_impl.c.h b/Modules/_blake2/clinic/blake2b_impl.c.h index f820006e58b768..12920ef3d0403f 100644 --- a/Modules/_blake2/clinic/blake2b_impl.c.h +++ b/Modules/_blake2/clinic/blake2b_impl.c.h @@ -72,7 +72,7 @@ py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&key, 'C')) { - _PyArg_BadArgument("blake2b", 3, "key", "contiguous buffer", fastargs[2]); + _PyArg_BadArgument("blake2b", 3, "argument 'key'", "contiguous buffer", fastargs[2]); goto exit; } if (!--noptargs) { @@ -84,7 +84,7 @@ py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&salt, 'C')) { - _PyArg_BadArgument("blake2b", 4, "salt", "contiguous buffer", fastargs[3]); + _PyArg_BadArgument("blake2b", 4, "argument 'salt'", "contiguous buffer", fastargs[3]); goto exit; } if (!--noptargs) { @@ -96,7 +96,7 @@ py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&person, 'C')) { - _PyArg_BadArgument("blake2b", 5, "person", "contiguous buffer", fastargs[4]); + _PyArg_BadArgument("blake2b", 5, "argument 'person'", "contiguous buffer", fastargs[4]); goto exit; } if (!--noptargs) { @@ -261,4 +261,4 @@ _blake2_blake2b_hexdigest(BLAKE2bObject *self, PyObject *Py_UNUSED(ignored)) { return _blake2_blake2b_hexdigest_impl(self); } -/*[clinic end generated code: output=dda27ce5a2bfc110 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6186e23d1ccf890d input=a9049054013a1b77]*/ diff --git a/Modules/_blake2/clinic/blake2s_impl.c.h b/Modules/_blake2/clinic/blake2s_impl.c.h index 90cb848b07625a..4e11df4cb0c99d 100644 --- a/Modules/_blake2/clinic/blake2s_impl.c.h +++ b/Modules/_blake2/clinic/blake2s_impl.c.h @@ -72,7 +72,7 @@ py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&key, 'C')) { - _PyArg_BadArgument("blake2s", 3, "key", "contiguous buffer", fastargs[2]); + _PyArg_BadArgument("blake2s", 3, "argument 'key'", "contiguous buffer", fastargs[2]); goto exit; } if (!--noptargs) { @@ -84,7 +84,7 @@ py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&salt, 'C')) { - _PyArg_BadArgument("blake2s", 4, "salt", "contiguous buffer", fastargs[3]); + _PyArg_BadArgument("blake2s", 4, "argument 'salt'", "contiguous buffer", fastargs[3]); goto exit; } if (!--noptargs) { @@ -96,7 +96,7 @@ py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&person, 'C')) { - _PyArg_BadArgument("blake2s", 5, "person", "contiguous buffer", fastargs[4]); + _PyArg_BadArgument("blake2s", 5, "argument 'person'", "contiguous buffer", fastargs[4]); goto exit; } if (!--noptargs) { @@ -261,4 +261,4 @@ _blake2_blake2s_hexdigest(BLAKE2sObject *self, PyObject *Py_UNUSED(ignored)) { return _blake2_blake2s_hexdigest_impl(self); } -/*[clinic end generated code: output=2fbf7c84460a98cf input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7de1fdb386eb0858 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/_iomodule.c.h b/Modules/_io/clinic/_iomodule.c.h index e6e5bf6951e552..a02434d2010ec4 100644 --- a/Modules/_io/clinic/_iomodule.c.h +++ b/Modules/_io/clinic/_iomodule.c.h @@ -161,7 +161,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw } if (args[1]) { if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("open", 2, "mode", "str", args[1]); + _PyArg_BadArgument("open", 2, "argument 'mode'", "str", args[1]); goto exit; } Py_ssize_t mode_length; @@ -207,7 +207,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw } } else { - _PyArg_BadArgument("open", 4, "encoding", "str or None", args[3]); + _PyArg_BadArgument("open", 4, "argument 'encoding'", "str or None", args[3]); goto exit; } if (!--noptargs) { @@ -230,7 +230,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw } } else { - _PyArg_BadArgument("open", 5, "errors", "str or None", args[4]); + _PyArg_BadArgument("open", 5, "argument 'errors'", "str or None", args[4]); goto exit; } if (!--noptargs) { @@ -253,7 +253,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw } } else { - _PyArg_BadArgument("open", 6, "newline", "str or None", args[5]); + _PyArg_BadArgument("open", 6, "argument 'newline'", "str or None", args[5]); goto exit; } if (!--noptargs) { @@ -311,7 +311,7 @@ _io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("open_code", 1, "path", "str", args[0]); + _PyArg_BadArgument("open_code", 1, "argument 'path'", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -323,4 +323,4 @@ _io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=c9b417c2cdcf46cc input=a9049054013a1b77]*/ +/*[clinic end generated code: output=16642398793371ec input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bufferedio.c.h b/Modules/_io/clinic/bufferedio.c.h index 7d4536462ac8ba..564d77e316dc9e 100644 --- a/Modules/_io/clinic/bufferedio.c.h +++ b/Modules/_io/clinic/bufferedio.c.h @@ -21,11 +21,11 @@ _io__BufferedIOBase_readinto(PyObject *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", 0, NULL, "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", 0, "argument", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("readinto", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = _io__BufferedIOBase_readinto_impl(self, &buffer); @@ -58,11 +58,11 @@ _io__BufferedIOBase_readinto1(PyObject *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto1", 0, NULL, "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto1", 0, "argument", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto1", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("readinto1", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = _io__BufferedIOBase_readinto1_impl(self, &buffer); @@ -243,11 +243,11 @@ _io__Buffered_readinto(buffered *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", 0, NULL, "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", 0, "argument", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("readinto", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = _io__Buffered_readinto_impl(self, &buffer); @@ -280,11 +280,11 @@ _io__Buffered_readinto1(buffered *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto1", 0, NULL, "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto1", 0, "argument", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto1", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("readinto1", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = _io__Buffered_readinto1_impl(self, &buffer); @@ -538,7 +538,7 @@ _io_BufferedWriter_write(buffered *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("write", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("write", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = _io_BufferedWriter_write_impl(self, &buffer); @@ -672,4 +672,4 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=9a76e118fff43645 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c5bdcc46d36124ff input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bytesio.c.h b/Modules/_io/clinic/bytesio.c.h index b2dba94cfcd548..fbdfb3b723aebc 100644 --- a/Modules/_io/clinic/bytesio.c.h +++ b/Modules/_io/clinic/bytesio.c.h @@ -319,11 +319,11 @@ _io_BytesIO_readinto(bytesio *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", 0, NULL, "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", 0, "argument", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("readinto", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = _io_BytesIO_readinto_impl(self, &buffer); @@ -515,4 +515,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=faf7289ed32a5e71 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e7d7e9041e6eb116 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/fileio.c.h b/Modules/_io/clinic/fileio.c.h index f3e0adfc44d7c8..ec60c2cda008f5 100644 --- a/Modules/_io/clinic/fileio.c.h +++ b/Modules/_io/clinic/fileio.c.h @@ -70,7 +70,7 @@ _io_FileIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) } if (fastargs[1]) { if (!PyUnicode_Check(fastargs[1])) { - _PyArg_BadArgument("FileIO", 2, "mode", "str", fastargs[1]); + _PyArg_BadArgument("FileIO", 2, "argument 'mode'", "str", fastargs[1]); goto exit; } Py_ssize_t mode_length; @@ -200,11 +200,11 @@ _io_FileIO_readinto(fileio *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", 0, NULL, "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", 0, "argument", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("readinto", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = _io_FileIO_readinto_impl(self, &buffer); @@ -303,7 +303,7 @@ _io_FileIO_write(fileio *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&b, 'C')) { - _PyArg_BadArgument("write", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("write", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = _io_FileIO_write_impl(self, &b); @@ -447,4 +447,4 @@ _io_FileIO_isatty(fileio *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO_FILEIO_TRUNCATE_METHODDEF #define _IO_FILEIO_TRUNCATE_METHODDEF #endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */ -/*[clinic end generated code: output=a651c69701eccbaa input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ac058b01a373e2d7 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/textio.c.h b/Modules/_io/clinic/textio.c.h index b845e57c4d1243..1f6d83615f1fd5 100644 --- a/Modules/_io/clinic/textio.c.h +++ b/Modules/_io/clinic/textio.c.h @@ -229,7 +229,7 @@ _io_TextIOWrapper___init__(PyObject *self, PyObject *args, PyObject *kwargs) } } else { - _PyArg_BadArgument("TextIOWrapper", 2, "encoding", "str or None", fastargs[1]); + _PyArg_BadArgument("TextIOWrapper", 2, "argument 'encoding'", "str or None", fastargs[1]); goto exit; } if (!--noptargs) { @@ -258,7 +258,7 @@ _io_TextIOWrapper___init__(PyObject *self, PyObject *args, PyObject *kwargs) } } else { - _PyArg_BadArgument("TextIOWrapper", 4, "newline", "str or None", fastargs[3]); + _PyArg_BadArgument("TextIOWrapper", 4, "argument 'newline'", "str or None", fastargs[3]); goto exit; } if (!--noptargs) { @@ -401,7 +401,7 @@ _io_TextIOWrapper_write(textio *self, PyObject *arg) PyObject *text; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("write", 0, NULL, "str", arg); + _PyArg_BadArgument("write", 0, "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -701,4 +701,4 @@ _io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored)) { return _io_TextIOWrapper_close_impl(self); } -/*[clinic end generated code: output=aa82a263f8ca3b83 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fa25e938e78ed2c7 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/winconsoleio.c.h b/Modules/_io/clinic/winconsoleio.c.h index 9d473bef9a4c2a..9a292e84e6b174 100644 --- a/Modules/_io/clinic/winconsoleio.c.h +++ b/Modules/_io/clinic/winconsoleio.c.h @@ -69,7 +69,7 @@ _io__WindowsConsoleIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) } if (fastargs[1]) { if (!PyUnicode_Check(fastargs[1])) { - _PyArg_BadArgument("_WindowsConsoleIO", 2, "mode", "str", fastargs[1]); + _PyArg_BadArgument("_WindowsConsoleIO", 2, "argument 'mode'", "str", fastargs[1]); goto exit; } Py_ssize_t mode_length; @@ -200,11 +200,11 @@ _io__WindowsConsoleIO_readinto(winconsoleio *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", 0, NULL, "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", 0, "argument", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("readinto", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = _io__WindowsConsoleIO_readinto_impl(self, &buffer); @@ -313,7 +313,7 @@ _io__WindowsConsoleIO_write(winconsoleio *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&b, 'C')) { - _PyArg_BadArgument("write", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("write", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = _io__WindowsConsoleIO_write_impl(self, &b); @@ -386,4 +386,4 @@ _io__WindowsConsoleIO_isatty(winconsoleio *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */ -/*[clinic end generated code: output=114d178a4bce2d3c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4d3874d820766005 input=a9049054013a1b77]*/ diff --git a/Modules/_multiprocessing/clinic/posixshmem.c.h b/Modules/_multiprocessing/clinic/posixshmem.c.h index 7353da16e4ccf9..301c0a511182d4 100644 --- a/Modules/_multiprocessing/clinic/posixshmem.c.h +++ b/Modules/_multiprocessing/clinic/posixshmem.c.h @@ -35,7 +35,7 @@ _posixshmem_shm_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("shm_open", 1, "path", "str", args[0]); + _PyArg_BadArgument("shm_open", 1, "argument 'path'", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -108,7 +108,7 @@ _posixshmem_shm_unlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("shm_unlink", 1, "path", "str", args[0]); + _PyArg_BadArgument("shm_unlink", 1, "argument 'path'", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -130,4 +130,4 @@ _posixshmem_shm_unlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs #ifndef _POSIXSHMEM_SHM_UNLINK_METHODDEF #define _POSIXSHMEM_SHM_UNLINK_METHODDEF #endif /* !defined(_POSIXSHMEM_SHM_UNLINK_METHODDEF) */ -/*[clinic end generated code: output=0ca2e33a850af257 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6f0f6a641a6f1a1c input=a9049054013a1b77]*/ diff --git a/Modules/cjkcodecs/clinic/multibytecodec.c.h b/Modules/cjkcodecs/clinic/multibytecodec.c.h index f79255372e4328..f4704aa827ca0b 100644 --- a/Modules/cjkcodecs/clinic/multibytecodec.c.h +++ b/Modules/cjkcodecs/clinic/multibytecodec.c.h @@ -55,7 +55,7 @@ _multibytecodec_MultibyteCodec_encode(MultibyteCodecObject *self, PyObject *cons } } else { - _PyArg_BadArgument("encode", 2, "errors", "str or None", args[1]); + _PyArg_BadArgument("encode", 2, "argument 'errors'", "str or None", args[1]); goto exit; } skip_optional_pos: @@ -103,7 +103,7 @@ _multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject *cons goto exit; } if (!PyBuffer_IsContiguous(&input, 'C')) { - _PyArg_BadArgument("decode", 1, "input", "contiguous buffer", args[0]); + _PyArg_BadArgument("decode", 1, "argument 'input'", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -124,7 +124,7 @@ _multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject *cons } } else { - _PyArg_BadArgument("decode", 2, "errors", "str or None", args[1]); + _PyArg_BadArgument("decode", 2, "argument 'errors'", "str or None", args[1]); goto exit; } skip_optional_pos: @@ -223,7 +223,7 @@ _multibytecodec_MultibyteIncrementalEncoder_setstate(MultibyteIncrementalEncoder PyLongObject *statelong; if (!PyLong_Check(arg)) { - _PyArg_BadArgument("setstate", 0, NULL, "int", arg); + _PyArg_BadArgument("setstate", 0, "argument", "int", arg); goto exit; } statelong = (PyLongObject *)arg; @@ -282,7 +282,7 @@ _multibytecodec_MultibyteIncrementalDecoder_decode(MultibyteIncrementalDecoderOb goto exit; } if (!PyBuffer_IsContiguous(&input, 'C')) { - _PyArg_BadArgument("decode", 1, "input", "contiguous buffer", args[0]); + _PyArg_BadArgument("decode", 1, "argument 'input'", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -345,7 +345,7 @@ _multibytecodec_MultibyteIncrementalDecoder_setstate(MultibyteIncrementalDecoder PyObject *state; if (!PyTuple_Check(arg)) { - _PyArg_BadArgument("setstate", 0, NULL, "tuple", arg); + _PyArg_BadArgument("setstate", 0, "argument", "tuple", arg); goto exit; } state = arg; @@ -525,4 +525,4 @@ PyDoc_STRVAR(_multibytecodec___create_codec__doc__, #define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \ {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__}, -/*[clinic end generated code: output=3e8d48c84507df24 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=01ee90b93764f1ac input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_bz2module.c.h b/Modules/clinic/_bz2module.c.h index c28f69b13fbfdd..6bbc8d9d2d6cff 100644 --- a/Modules/clinic/_bz2module.c.h +++ b/Modules/clinic/_bz2module.c.h @@ -29,7 +29,7 @@ _bz2_BZ2Compressor_compress(BZ2Compressor *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("compress", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("compress", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = _bz2_BZ2Compressor_compress_impl(self, &data); @@ -156,7 +156,7 @@ _bz2_BZ2Decompressor_decompress(BZ2Decompressor *self, PyObject *const *args, Py goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("decompress", 1, "data", "contiguous buffer", args[0]); + _PyArg_BadArgument("decompress", 1, "argument 'data'", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -220,4 +220,4 @@ _bz2_BZ2Decompressor___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=c3492ffd3d19acee input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fbf0d1d73fdfb859 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_codecsmodule.c.h b/Modules/clinic/_codecsmodule.c.h index 76d6828a447675..c0f8c4fbee00e1 100644 --- a/Modules/clinic/_codecsmodule.c.h +++ b/Modules/clinic/_codecsmodule.c.h @@ -34,7 +34,7 @@ _codecs_lookup(PyObject *module, PyObject *arg) const char *encoding; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("lookup", 0, NULL, "str", arg); + _PyArg_BadArgument("lookup", 0, "argument", "str", arg); goto exit; } Py_ssize_t encoding_length; @@ -93,7 +93,7 @@ _codecs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[1]) { if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("encode", 2, "encoding", "str", args[1]); + _PyArg_BadArgument("encode", 2, "argument 'encoding'", "str", args[1]); goto exit; } Py_ssize_t encoding_length; @@ -110,7 +110,7 @@ _codecs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje } } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("encode", 3, "errors", "str", args[2]); + _PyArg_BadArgument("encode", 3, "argument 'errors'", "str", args[2]); goto exit; } Py_ssize_t errors_length; @@ -170,7 +170,7 @@ _codecs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[1]) { if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("decode", 2, "encoding", "str", args[1]); + _PyArg_BadArgument("decode", 2, "argument 'encoding'", "str", args[1]); goto exit; } Py_ssize_t encoding_length; @@ -187,7 +187,7 @@ _codecs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje } } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("decode", 3, "errors", "str", args[2]); + _PyArg_BadArgument("decode", 3, "argument 'errors'", "str", args[2]); goto exit; } Py_ssize_t errors_length; @@ -225,7 +225,7 @@ _codecs__forget_codec(PyObject *module, PyObject *arg) const char *encoding; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("_forget_codec", 0, NULL, "str", arg); + _PyArg_BadArgument("_forget_codec", 0, "argument", "str", arg); goto exit; } Py_ssize_t encoding_length; @@ -278,7 +278,7 @@ _codecs_escape_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("escape_decode", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("escape_decode", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } } @@ -300,7 +300,7 @@ _codecs_escape_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("escape_decode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("escape_decode", 2, "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -338,7 +338,7 @@ _codecs_escape_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBytes_Check(args[0])) { - _PyArg_BadArgument("escape_encode", 1, NULL, "bytes", args[0]); + _PyArg_BadArgument("escape_encode", 1, "argument 1", "bytes", args[0]); goto exit; } data = args[0]; @@ -360,7 +360,7 @@ _codecs_escape_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("escape_encode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("escape_encode", 2, "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -397,7 +397,7 @@ _codecs_utf_7_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_7_decode", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_7_decode", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -418,7 +418,7 @@ _codecs_utf_7_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_7_decode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("utf_7_decode", 2, "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -472,7 +472,7 @@ _codecs_utf_8_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_8_decode", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_8_decode", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -493,7 +493,7 @@ _codecs_utf_8_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_8_decode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("utf_8_decode", 2, "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -547,7 +547,7 @@ _codecs_utf_16_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_16_decode", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_16_decode", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -568,7 +568,7 @@ _codecs_utf_16_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_16_decode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("utf_16_decode", 2, "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -622,7 +622,7 @@ _codecs_utf_16_le_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_16_le_decode", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_16_le_decode", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -643,7 +643,7 @@ _codecs_utf_16_le_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_le_decode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("utf_16_le_decode", 2, "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -697,7 +697,7 @@ _codecs_utf_16_be_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_16_be_decode", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_16_be_decode", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -718,7 +718,7 @@ _codecs_utf_16_be_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_be_decode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("utf_16_be_decode", 2, "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -774,7 +774,7 @@ _codecs_utf_16_ex_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_16_ex_decode", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_16_ex_decode", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -795,7 +795,7 @@ _codecs_utf_16_ex_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_ex_decode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("utf_16_ex_decode", 2, "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -861,7 +861,7 @@ _codecs_utf_32_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_32_decode", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_32_decode", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -882,7 +882,7 @@ _codecs_utf_32_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_32_decode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("utf_32_decode", 2, "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -936,7 +936,7 @@ _codecs_utf_32_le_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_32_le_decode", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_32_le_decode", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -957,7 +957,7 @@ _codecs_utf_32_le_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_le_decode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("utf_32_le_decode", 2, "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1011,7 +1011,7 @@ _codecs_utf_32_be_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_32_be_decode", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_32_be_decode", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1032,7 +1032,7 @@ _codecs_utf_32_be_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_be_decode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("utf_32_be_decode", 2, "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1088,7 +1088,7 @@ _codecs_utf_32_ex_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_32_ex_decode", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_32_ex_decode", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1109,7 +1109,7 @@ _codecs_utf_32_ex_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_ex_decode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("utf_32_ex_decode", 2, "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1183,7 +1183,7 @@ _codecs_unicode_escape_decode(PyObject *module, PyObject *const *args, Py_ssize_ goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("unicode_escape_decode", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("unicode_escape_decode", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } } @@ -1205,7 +1205,7 @@ _codecs_unicode_escape_decode(PyObject *module, PyObject *const *args, Py_ssize_ } } else { - _PyArg_BadArgument("unicode_escape_decode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("unicode_escape_decode", 2, "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -1255,7 +1255,7 @@ _codecs_raw_unicode_escape_decode(PyObject *module, PyObject *const *args, Py_ss goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("raw_unicode_escape_decode", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("raw_unicode_escape_decode", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } } @@ -1277,7 +1277,7 @@ _codecs_raw_unicode_escape_decode(PyObject *module, PyObject *const *args, Py_ss } } else { - _PyArg_BadArgument("raw_unicode_escape_decode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("raw_unicode_escape_decode", 2, "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -1318,7 +1318,7 @@ _codecs_latin_1_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("latin_1_decode", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("latin_1_decode", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1339,7 +1339,7 @@ _codecs_latin_1_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs } } else { - _PyArg_BadArgument("latin_1_decode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("latin_1_decode", 2, "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -1380,7 +1380,7 @@ _codecs_ascii_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("ascii_decode", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("ascii_decode", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1401,7 +1401,7 @@ _codecs_ascii_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("ascii_decode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("ascii_decode", 2, "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -1443,7 +1443,7 @@ _codecs_charmap_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("charmap_decode", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("charmap_decode", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1464,7 +1464,7 @@ _codecs_charmap_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs } } else { - _PyArg_BadArgument("charmap_decode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("charmap_decode", 2, "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1512,7 +1512,7 @@ _codecs_mbcs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("mbcs_decode", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("mbcs_decode", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1533,7 +1533,7 @@ _codecs_mbcs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("mbcs_decode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("mbcs_decode", 2, "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1591,7 +1591,7 @@ _codecs_oem_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("oem_decode", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("oem_decode", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1612,7 +1612,7 @@ _codecs_oem_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("oem_decode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("oem_decode", 2, "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1680,7 +1680,7 @@ _codecs_code_page_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("code_page_decode", 2, NULL, "contiguous buffer", args[1]); + _PyArg_BadArgument("code_page_decode", 2, "argument 2", "contiguous buffer", args[1]); goto exit; } if (nargs < 3) { @@ -1701,7 +1701,7 @@ _codecs_code_page_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("code_page_decode", 3, NULL, "str or None", args[2]); + _PyArg_BadArgument("code_page_decode", 3, "argument 3", "str or None", args[2]); goto exit; } if (nargs < 4) { @@ -1765,7 +1765,7 @@ _codecs_readbuffer_encode(PyObject *module, PyObject *const *args, Py_ssize_t na goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("readbuffer_encode", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("readbuffer_encode", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } } @@ -1787,7 +1787,7 @@ _codecs_readbuffer_encode(PyObject *module, PyObject *const *args, Py_ssize_t na } } else { - _PyArg_BadArgument("readbuffer_encode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("readbuffer_encode", 2, "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -1825,7 +1825,7 @@ _codecs_utf_7_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_7_encode", 1, NULL, "str", args[0]); + _PyArg_BadArgument("utf_7_encode", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -1850,7 +1850,7 @@ _codecs_utf_7_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_7_encode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("utf_7_encode", 2, "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -1883,7 +1883,7 @@ _codecs_utf_8_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_8_encode", 1, NULL, "str", args[0]); + _PyArg_BadArgument("utf_8_encode", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -1908,7 +1908,7 @@ _codecs_utf_8_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_8_encode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("utf_8_encode", 2, "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -1942,7 +1942,7 @@ _codecs_utf_16_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_16_encode", 1, NULL, "str", args[0]); + _PyArg_BadArgument("utf_16_encode", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -1967,7 +1967,7 @@ _codecs_utf_16_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_16_encode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("utf_16_encode", 2, "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -2012,7 +2012,7 @@ _codecs_utf_16_le_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_16_le_encode", 1, NULL, "str", args[0]); + _PyArg_BadArgument("utf_16_le_encode", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2037,7 +2037,7 @@ _codecs_utf_16_le_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_le_encode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("utf_16_le_encode", 2, "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2070,7 +2070,7 @@ _codecs_utf_16_be_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_16_be_encode", 1, NULL, "str", args[0]); + _PyArg_BadArgument("utf_16_be_encode", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2095,7 +2095,7 @@ _codecs_utf_16_be_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_be_encode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("utf_16_be_encode", 2, "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2129,7 +2129,7 @@ _codecs_utf_32_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_32_encode", 1, NULL, "str", args[0]); + _PyArg_BadArgument("utf_32_encode", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2154,7 +2154,7 @@ _codecs_utf_32_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_32_encode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("utf_32_encode", 2, "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -2199,7 +2199,7 @@ _codecs_utf_32_le_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_32_le_encode", 1, NULL, "str", args[0]); + _PyArg_BadArgument("utf_32_le_encode", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2224,7 +2224,7 @@ _codecs_utf_32_le_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_le_encode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("utf_32_le_encode", 2, "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2257,7 +2257,7 @@ _codecs_utf_32_be_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_32_be_encode", 1, NULL, "str", args[0]); + _PyArg_BadArgument("utf_32_be_encode", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2282,7 +2282,7 @@ _codecs_utf_32_be_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_be_encode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("utf_32_be_encode", 2, "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2315,7 +2315,7 @@ _codecs_unicode_escape_encode(PyObject *module, PyObject *const *args, Py_ssize_ goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("unicode_escape_encode", 1, NULL, "str", args[0]); + _PyArg_BadArgument("unicode_escape_encode", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2340,7 +2340,7 @@ _codecs_unicode_escape_encode(PyObject *module, PyObject *const *args, Py_ssize_ } } else { - _PyArg_BadArgument("unicode_escape_encode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("unicode_escape_encode", 2, "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2373,7 +2373,7 @@ _codecs_raw_unicode_escape_encode(PyObject *module, PyObject *const *args, Py_ss goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("raw_unicode_escape_encode", 1, NULL, "str", args[0]); + _PyArg_BadArgument("raw_unicode_escape_encode", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2398,7 +2398,7 @@ _codecs_raw_unicode_escape_encode(PyObject *module, PyObject *const *args, Py_ss } } else { - _PyArg_BadArgument("raw_unicode_escape_encode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("raw_unicode_escape_encode", 2, "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2431,7 +2431,7 @@ _codecs_latin_1_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("latin_1_encode", 1, NULL, "str", args[0]); + _PyArg_BadArgument("latin_1_encode", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2456,7 +2456,7 @@ _codecs_latin_1_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs } } else { - _PyArg_BadArgument("latin_1_encode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("latin_1_encode", 2, "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2489,7 +2489,7 @@ _codecs_ascii_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("ascii_encode", 1, NULL, "str", args[0]); + _PyArg_BadArgument("ascii_encode", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2514,7 +2514,7 @@ _codecs_ascii_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("ascii_encode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("ascii_encode", 2, "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2548,7 +2548,7 @@ _codecs_charmap_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("charmap_encode", 1, NULL, "str", args[0]); + _PyArg_BadArgument("charmap_encode", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2573,7 +2573,7 @@ _codecs_charmap_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs } } else { - _PyArg_BadArgument("charmap_encode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("charmap_encode", 2, "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -2605,7 +2605,7 @@ _codecs_charmap_build(PyObject *module, PyObject *arg) PyObject *map; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("charmap_build", 0, NULL, "str", arg); + _PyArg_BadArgument("charmap_build", 0, "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -2642,7 +2642,7 @@ _codecs_mbcs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("mbcs_encode", 1, NULL, "str", args[0]); + _PyArg_BadArgument("mbcs_encode", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2667,7 +2667,7 @@ _codecs_mbcs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("mbcs_encode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("mbcs_encode", 2, "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2703,7 +2703,7 @@ _codecs_oem_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("oem_encode", 1, NULL, "str", args[0]); + _PyArg_BadArgument("oem_encode", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2728,7 +2728,7 @@ _codecs_oem_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("oem_encode", 2, NULL, "str or None", args[1]); + _PyArg_BadArgument("oem_encode", 2, "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2775,7 +2775,7 @@ _codecs_code_page_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("code_page_encode", 2, NULL, "str", args[1]); + _PyArg_BadArgument("code_page_encode", 2, "argument 2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -2800,7 +2800,7 @@ _codecs_code_page_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("code_page_encode", 3, NULL, "str or None", args[2]); + _PyArg_BadArgument("code_page_encode", 3, "argument 3", "str or None", args[2]); goto exit; } skip_optional: @@ -2840,7 +2840,7 @@ _codecs_register_error(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("register_error", 1, NULL, "str", args[0]); + _PyArg_BadArgument("register_error", 1, "argument 1", "str", args[0]); goto exit; } Py_ssize_t errors_length; @@ -2881,7 +2881,7 @@ _codecs_lookup_error(PyObject *module, PyObject *arg) const char *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("lookup_error", 0, NULL, "str", arg); + _PyArg_BadArgument("lookup_error", 0, "argument", "str", arg); goto exit; } Py_ssize_t name_length; @@ -2922,4 +2922,4 @@ _codecs_lookup_error(PyObject *module, PyObject *arg) #ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF #define _CODECS_CODE_PAGE_ENCODE_METHODDEF #endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */ -/*[clinic end generated code: output=26916fab3ce5146a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=421563186b21a798 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_cryptmodule.c.h b/Modules/clinic/_cryptmodule.c.h index 91f6d968b1d816..86c7a359c72d5f 100644 --- a/Modules/clinic/_cryptmodule.c.h +++ b/Modules/clinic/_cryptmodule.c.h @@ -30,7 +30,7 @@ crypt_crypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("crypt", 1, NULL, "str", args[0]); + _PyArg_BadArgument("crypt", 1, "argument 1", "str", args[0]); goto exit; } Py_ssize_t word_length; @@ -43,7 +43,7 @@ crypt_crypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("crypt", 2, NULL, "str", args[1]); + _PyArg_BadArgument("crypt", 2, "argument 2", "str", args[1]); goto exit; } Py_ssize_t salt_length; @@ -60,4 +60,4 @@ crypt_crypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=589300f2e87a07a9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2852ce911bcdd087 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_curses_panel.c.h b/Modules/clinic/_curses_panel.c.h index 0d499b9f60efa7..22208914db5050 100644 --- a/Modules/clinic/_curses_panel.c.h +++ b/Modules/clinic/_curses_panel.c.h @@ -214,7 +214,7 @@ _curses_panel_panel_replace(PyCursesPanelObject *self, PyObject *arg) PyCursesWindowObject *win; if (!PyObject_TypeCheck(arg, &PyCursesWindow_Type)) { - _PyArg_BadArgument("replace", 0, NULL, (&PyCursesWindow_Type)->tp_name, arg); + _PyArg_BadArgument("replace", 0, "argument", (&PyCursesWindow_Type)->tp_name, arg); goto exit; } win = (PyCursesWindowObject *)arg; @@ -288,7 +288,7 @@ _curses_panel_new_panel(PyObject *module, PyObject *arg) PyCursesWindowObject *win; if (!PyObject_TypeCheck(arg, &PyCursesWindow_Type)) { - _PyArg_BadArgument("new_panel", 0, NULL, (&PyCursesWindow_Type)->tp_name, arg); + _PyArg_BadArgument("new_panel", 0, "argument", (&PyCursesWindow_Type)->tp_name, arg); goto exit; } win = (PyCursesWindowObject *)arg; @@ -335,4 +335,4 @@ _curses_panel_update_panels(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _curses_panel_update_panels_impl(module); } -/*[clinic end generated code: output=b9ea85a52962e209 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5c0578d645fc9688 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_cursesmodule.c.h b/Modules/clinic/_cursesmodule.c.h index 0daf0e7d37e7e2..a2036dc7f186c1 100644 --- a/Modules/clinic/_cursesmodule.c.h +++ b/Modules/clinic/_cursesmodule.c.h @@ -2521,7 +2521,7 @@ _curses_ungetmouse(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyLong_Check(args[4])) { - _PyArg_BadArgument("ungetmouse", 5, NULL, "int", args[4]); + _PyArg_BadArgument("ungetmouse", 5, "argument 5", "int", args[4]); goto exit; } bstate = PyLong_AsUnsignedLongMask(args[4]); @@ -3017,7 +3017,7 @@ _curses_setupterm(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO } } else { - _PyArg_BadArgument("setupterm", 1, "term", "str or None", args[0]); + _PyArg_BadArgument("setupterm", 1, "argument 'term'", "str or None", args[0]); goto exit; } if (!--noptargs) { @@ -3326,7 +3326,7 @@ _curses_mousemask(PyObject *module, PyObject *arg) unsigned long newmask; if (!PyLong_Check(arg)) { - _PyArg_BadArgument("mousemask", 0, NULL, "int", arg); + _PyArg_BadArgument("mousemask", 0, "argument", "int", arg); goto exit; } newmask = PyLong_AsUnsignedLongMask(arg); @@ -4201,7 +4201,7 @@ _curses_tigetflag(PyObject *module, PyObject *arg) const char *capname; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("tigetflag", 0, NULL, "str", arg); + _PyArg_BadArgument("tigetflag", 0, "argument", "str", arg); goto exit; } Py_ssize_t capname_length; @@ -4244,7 +4244,7 @@ _curses_tigetnum(PyObject *module, PyObject *arg) const char *capname; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("tigetnum", 0, NULL, "str", arg); + _PyArg_BadArgument("tigetnum", 0, "argument", "str", arg); goto exit; } Py_ssize_t capname_length; @@ -4287,7 +4287,7 @@ _curses_tigetstr(PyObject *module, PyObject *arg) const char *capname; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("tigetstr", 0, NULL, "str", arg); + _PyArg_BadArgument("tigetstr", 0, "argument", "str", arg); goto exit; } Py_ssize_t capname_length; @@ -4569,4 +4569,4 @@ _curses_use_default_colors(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef _CURSES_USE_DEFAULT_COLORS_METHODDEF #define _CURSES_USE_DEFAULT_COLORS_METHODDEF #endif /* !defined(_CURSES_USE_DEFAULT_COLORS_METHODDEF) */ -/*[clinic end generated code: output=b79d2d74391a91ff input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d9d73b7b67072df0 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_dbmmodule.c.h b/Modules/clinic/_dbmmodule.c.h index 2385ceee1da4b0..b03c3df2d9e3ac 100644 --- a/Modules/clinic/_dbmmodule.c.h +++ b/Modules/clinic/_dbmmodule.c.h @@ -136,7 +136,7 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("open", 1, NULL, "str", args[0]); + _PyArg_BadArgument("open", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -147,7 +147,7 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("open", 2, NULL, "str", args[1]); + _PyArg_BadArgument("open", 2, "argument 2", "str", args[1]); goto exit; } Py_ssize_t flags_length; @@ -177,4 +177,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=bbaecc68a23e54d7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=80913e23c097cba2 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_elementtree.c.h b/Modules/clinic/_elementtree.c.h index 2dc1334a283589..48eddb30ed75e6 100644 --- a/Modules/clinic/_elementtree.c.h +++ b/Modules/clinic/_elementtree.c.h @@ -20,7 +20,7 @@ _elementtree_Element_append(ElementObject *self, PyObject *arg) PyObject *subelement; if (!PyObject_TypeCheck(arg, &Element_Type)) { - _PyArg_BadArgument("append", 0, NULL, (&Element_Type)->tp_name, arg); + _PyArg_BadArgument("append", 0, "argument", (&Element_Type)->tp_name, arg); goto exit; } subelement = arg; @@ -82,7 +82,7 @@ _elementtree_Element___deepcopy__(ElementObject *self, PyObject *arg) PyObject *memo; if (!PyDict_Check(arg)) { - _PyArg_BadArgument("__deepcopy__", 0, NULL, "dict", arg); + _PyArg_BadArgument("__deepcopy__", 0, "argument", "dict", arg); goto exit; } memo = arg; @@ -501,7 +501,7 @@ _elementtree_Element_insert(ElementObject *self, PyObject *const *args, Py_ssize index = ival; } if (!PyObject_TypeCheck(args[1], &Element_Type)) { - _PyArg_BadArgument("insert", 2, NULL, (&Element_Type)->tp_name, args[1]); + _PyArg_BadArgument("insert", 2, "argument 2", (&Element_Type)->tp_name, args[1]); goto exit; } subelement = args[1]; @@ -593,7 +593,7 @@ _elementtree_Element_remove(ElementObject *self, PyObject *arg) PyObject *subelement; if (!PyObject_TypeCheck(arg, &Element_Type)) { - _PyArg_BadArgument("remove", 0, NULL, (&Element_Type)->tp_name, arg); + _PyArg_BadArgument("remove", 0, "argument", (&Element_Type)->tp_name, arg); goto exit; } subelement = arg; @@ -892,7 +892,7 @@ _elementtree_XMLParser___init__(PyObject *self, PyObject *args, PyObject *kwargs } } else { - _PyArg_BadArgument("XMLParser", 2, "encoding", "str or None", fastargs[1]); + _PyArg_BadArgument("XMLParser", 2, "argument 'encoding'", "str or None", fastargs[1]); goto exit; } skip_optional_kwonly: @@ -969,4 +969,4 @@ _elementtree_XMLParser__setevents(XMLParserObject *self, PyObject *const *args, exit: return return_value; } -/*[clinic end generated code: output=7c113ba1f9ac82ff input=a9049054013a1b77]*/ +/*[clinic end generated code: output=eb4be5e90f6d2dc1 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_gdbmmodule.c.h b/Modules/clinic/_gdbmmodule.c.h index a370ebf47e15ed..81e5a89b9ae051 100644 --- a/Modules/clinic/_gdbmmodule.c.h +++ b/Modules/clinic/_gdbmmodule.c.h @@ -257,7 +257,7 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("open", 1, NULL, "str", args[0]); + _PyArg_BadArgument("open", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -268,7 +268,7 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("open", 2, NULL, "str", args[1]); + _PyArg_BadArgument("open", 2, "argument 2", "str", args[1]); goto exit; } Py_ssize_t flags_length; @@ -298,4 +298,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=ce9ed8c29a10355e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=70dd3dc96ca4de1c input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_hashopenssl.c.h b/Modules/clinic/_hashopenssl.c.h index 416e0e5826afd7..cd99a981d63efb 100644 --- a/Modules/clinic/_hashopenssl.c.h +++ b/Modules/clinic/_hashopenssl.c.h @@ -145,7 +145,7 @@ pbkdf2_hmac(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("pbkdf2_hmac", 1, "hash_name", "str", args[0]); + _PyArg_BadArgument("pbkdf2_hmac", 1, "argument 'hash_name'", "str", args[0]); goto exit; } Py_ssize_t hash_name_length; @@ -161,14 +161,14 @@ pbkdf2_hmac(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyBuffer_IsContiguous(&password, 'C')) { - _PyArg_BadArgument("pbkdf2_hmac", 2, "password", "contiguous buffer", args[1]); + _PyArg_BadArgument("pbkdf2_hmac", 2, "argument 'password'", "contiguous buffer", args[1]); goto exit; } if (PyObject_GetBuffer(args[2], &salt, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&salt, 'C')) { - _PyArg_BadArgument("pbkdf2_hmac", 3, "salt", "contiguous buffer", args[2]); + _PyArg_BadArgument("pbkdf2_hmac", 3, "argument 'salt'", "contiguous buffer", args[2]); goto exit; } if (PyFloat_Check(args[3])) { @@ -243,7 +243,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&password, 'C')) { - _PyArg_BadArgument("scrypt", 1, "password", "contiguous buffer", args[0]); + _PyArg_BadArgument("scrypt", 1, "argument 'password'", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -254,7 +254,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&salt, 'C')) { - _PyArg_BadArgument("scrypt", 2, "salt", "contiguous buffer", args[1]); + _PyArg_BadArgument("scrypt", 2, "argument 'salt'", "contiguous buffer", args[1]); goto exit; } if (!--noptargs) { @@ -263,7 +263,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj } if (args[2]) { if (!PyLong_Check(args[2])) { - _PyArg_BadArgument("scrypt", 3, "n", "int", args[2]); + _PyArg_BadArgument("scrypt", 3, "argument 'n'", "int", args[2]); goto exit; } n_obj = args[2]; @@ -273,7 +273,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj } if (args[3]) { if (!PyLong_Check(args[3])) { - _PyArg_BadArgument("scrypt", 4, "r", "int", args[3]); + _PyArg_BadArgument("scrypt", 4, "argument 'r'", "int", args[3]); goto exit; } r_obj = args[3]; @@ -283,7 +283,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj } if (args[4]) { if (!PyLong_Check(args[4])) { - _PyArg_BadArgument("scrypt", 5, "p", "int", args[4]); + _PyArg_BadArgument("scrypt", 5, "argument 'p'", "int", args[4]); goto exit; } p_obj = args[4]; @@ -364,18 +364,18 @@ _hashlib_hmac_digest(PyObject *module, PyObject *const *args, Py_ssize_t nargs, goto exit; } if (!PyBuffer_IsContiguous(&key, 'C')) { - _PyArg_BadArgument("hmac_digest", 1, "key", "contiguous buffer", args[0]); + _PyArg_BadArgument("hmac_digest", 1, "argument 'key'", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &msg, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&msg, 'C')) { - _PyArg_BadArgument("hmac_digest", 2, "msg", "contiguous buffer", args[1]); + _PyArg_BadArgument("hmac_digest", 2, "argument 'msg'", "contiguous buffer", args[1]); goto exit; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("hmac_digest", 3, "digest", "str", args[2]); + _PyArg_BadArgument("hmac_digest", 3, "argument 'digest'", "str", args[2]); goto exit; } Py_ssize_t digest_length; @@ -409,4 +409,4 @@ _hashlib_hmac_digest(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #ifndef _HASHLIB_SCRYPT_METHODDEF #define _HASHLIB_SCRYPT_METHODDEF #endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */ -/*[clinic end generated code: output=d19b13b0a11cd8d3 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=bc9ece72b44434fa input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_lzmamodule.c.h b/Modules/clinic/_lzmamodule.c.h index 37e25a6611f5e8..f08e7aa3b0d6ef 100644 --- a/Modules/clinic/_lzmamodule.c.h +++ b/Modules/clinic/_lzmamodule.c.h @@ -29,7 +29,7 @@ _lzma_LZMACompressor_compress(Compressor *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("compress", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("compress", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = _lzma_LZMACompressor_compress_impl(self, &data); @@ -110,7 +110,7 @@ _lzma_LZMADecompressor_decompress(Decompressor *self, PyObject *const *args, Py_ goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("decompress", 1, "data", "contiguous buffer", args[0]); + _PyArg_BadArgument("decompress", 1, "argument 'data'", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -321,7 +321,7 @@ _lzma__decode_filter_properties(PyObject *module, PyObject *const *args, Py_ssiz goto exit; } if (!PyBuffer_IsContiguous(&encoded_props, 'C')) { - _PyArg_BadArgument("_decode_filter_properties", 2, NULL, "contiguous buffer", args[1]); + _PyArg_BadArgument("_decode_filter_properties", 2, "argument 2", "contiguous buffer", args[1]); goto exit; } return_value = _lzma__decode_filter_properties_impl(module, filter_id, &encoded_props); @@ -334,4 +334,4 @@ _lzma__decode_filter_properties(PyObject *module, PyObject *const *args, Py_ssiz return return_value; } -/*[clinic end generated code: output=d3e401d5134c008f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3542c05a754219ec input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_pickle.c.h b/Modules/clinic/_pickle.c.h index 58dca4977b2f76..a26c24f80665e0 100644 --- a/Modules/clinic/_pickle.c.h +++ b/Modules/clinic/_pickle.c.h @@ -356,7 +356,7 @@ _pickle_Unpickler___init__(PyObject *self, PyObject *args, PyObject *kwargs) } if (fastargs[2]) { if (!PyUnicode_Check(fastargs[2])) { - _PyArg_BadArgument("Unpickler", 3, "encoding", "str", fastargs[2]); + _PyArg_BadArgument("Unpickler", 3, "argument 'encoding'", "str", fastargs[2]); goto exit; } Py_ssize_t encoding_length; @@ -374,7 +374,7 @@ _pickle_Unpickler___init__(PyObject *self, PyObject *args, PyObject *kwargs) } if (fastargs[3]) { if (!PyUnicode_Check(fastargs[3])) { - _PyArg_BadArgument("Unpickler", 4, "errors", "str", fastargs[3]); + _PyArg_BadArgument("Unpickler", 4, "argument 'errors'", "str", fastargs[3]); goto exit; } Py_ssize_t errors_length; @@ -691,7 +691,7 @@ _pickle_load(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject } if (args[2]) { if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("load", 3, "encoding", "str", args[2]); + _PyArg_BadArgument("load", 3, "argument 'encoding'", "str", args[2]); goto exit; } Py_ssize_t encoding_length; @@ -709,7 +709,7 @@ _pickle_load(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject } if (args[3]) { if (!PyUnicode_Check(args[3])) { - _PyArg_BadArgument("load", 4, "errors", "str", args[3]); + _PyArg_BadArgument("load", 4, "argument 'errors'", "str", args[3]); goto exit; } Py_ssize_t errors_length; @@ -794,7 +794,7 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec } if (args[2]) { if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("loads", 3, "encoding", "str", args[2]); + _PyArg_BadArgument("loads", 3, "argument 'encoding'", "str", args[2]); goto exit; } Py_ssize_t encoding_length; @@ -812,7 +812,7 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec } if (args[3]) { if (!PyUnicode_Check(args[3])) { - _PyArg_BadArgument("loads", 4, "errors", "str", args[3]); + _PyArg_BadArgument("loads", 4, "argument 'errors'", "str", args[3]); goto exit; } Py_ssize_t errors_length; @@ -835,4 +835,4 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=2dcf493ea059a277 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=eb5b6b91fd952802 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_sre.c.h b/Modules/clinic/_sre.c.h index c72e90d3cdf76f..bcc779e26c2ad0 100644 --- a/Modules/clinic/_sre.c.h +++ b/Modules/clinic/_sre.c.h @@ -894,7 +894,7 @@ _sre_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyList_Check(args[2])) { - _PyArg_BadArgument("compile", 3, "code", "list", args[2]); + _PyArg_BadArgument("compile", 3, "argument 'code'", "list", args[2]); goto exit; } code = args[2]; @@ -916,12 +916,12 @@ _sre_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject groups = ival; } if (!PyDict_Check(args[4])) { - _PyArg_BadArgument("compile", 5, "groupindex", "dict", args[4]); + _PyArg_BadArgument("compile", 5, "argument 'groupindex'", "dict", args[4]); goto exit; } groupindex = args[4]; if (!PyTuple_Check(args[5])) { - _PyArg_BadArgument("compile", 6, "indexgroup", "tuple", args[5]); + _PyArg_BadArgument("compile", 6, "argument 'indexgroup'", "tuple", args[5]); goto exit; } indexgroup = args[5]; @@ -1207,4 +1207,4 @@ _sre_SRE_Scanner_search(ScannerObject *self, PyObject *Py_UNUSED(ignored)) { return _sre_SRE_Scanner_search_impl(self); } -/*[clinic end generated code: output=2ffd8eb155f22c72 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a89e3c01563007e2 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_ssl.c.h b/Modules/clinic/_ssl.c.h index 48011ec3eb4eef..4716aef3fe0237 100644 --- a/Modules/clinic/_ssl.c.h +++ b/Modules/clinic/_ssl.c.h @@ -222,7 +222,7 @@ _ssl__SSLSocket_write(PySSLSocket *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&b, 'C')) { - _PyArg_BadArgument("write", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("write", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = _ssl__SSLSocket_write_impl(self, &b); @@ -353,7 +353,7 @@ _ssl__SSLSocket_get_channel_binding(PySSLSocket *self, PyObject *const *args, Py goto skip_optional_pos; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("get_channel_binding", 1, "cb_type", "str", args[0]); + _PyArg_BadArgument("get_channel_binding", 1, "argument 'cb_type'", "str", args[0]); goto exit; } Py_ssize_t cb_type_length; @@ -439,7 +439,7 @@ _ssl__SSLContext_set_ciphers(PySSLContext *self, PyObject *arg) const char *cipherlist; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("set_ciphers", 0, NULL, "str", arg); + _PyArg_BadArgument("set_ciphers", 0, "argument", "str", arg); goto exit; } Py_ssize_t cipherlist_length; @@ -500,7 +500,7 @@ _ssl__SSLContext__set_npn_protocols(PySSLContext *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&protos, 'C')) { - _PyArg_BadArgument("_set_npn_protocols", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("_set_npn_protocols", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = _ssl__SSLContext__set_npn_protocols_impl(self, &protos); @@ -536,7 +536,7 @@ _ssl__SSLContext__set_alpn_protocols(PySSLContext *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&protos, 'C')) { - _PyArg_BadArgument("_set_alpn_protocols", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("_set_alpn_protocols", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = _ssl__SSLContext__set_alpn_protocols_impl(self, &protos); @@ -690,7 +690,7 @@ _ssl__SSLContext__wrap_socket(PySSLContext *self, PyObject *const *args, Py_ssiz goto exit; } if (!PyObject_TypeCheck(args[0], PySocketModule.Sock_Type)) { - _PyArg_BadArgument("_wrap_socket", 1, "sock", (PySocketModule.Sock_Type)->tp_name, args[0]); + _PyArg_BadArgument("_wrap_socket", 1, "argument 'sock'", (PySocketModule.Sock_Type)->tp_name, args[0]); goto exit; } sock = args[0]; @@ -765,12 +765,12 @@ _ssl__SSLContext__wrap_bio(PySSLContext *self, PyObject *const *args, Py_ssize_t goto exit; } if (!PyObject_TypeCheck(args[0], &PySSLMemoryBIO_Type)) { - _PyArg_BadArgument("_wrap_bio", 1, "incoming", (&PySSLMemoryBIO_Type)->tp_name, args[0]); + _PyArg_BadArgument("_wrap_bio", 1, "argument 'incoming'", (&PySSLMemoryBIO_Type)->tp_name, args[0]); goto exit; } incoming = (PySSLMemoryBIO *)args[0]; if (!PyObject_TypeCheck(args[1], &PySSLMemoryBIO_Type)) { - _PyArg_BadArgument("_wrap_bio", 2, "outgoing", (&PySSLMemoryBIO_Type)->tp_name, args[1]); + _PyArg_BadArgument("_wrap_bio", 2, "argument 'outgoing'", (&PySSLMemoryBIO_Type)->tp_name, args[1]); goto exit; } outgoing = (PySSLMemoryBIO *)args[1]; @@ -1017,7 +1017,7 @@ _ssl_MemoryBIO_write(PySSLMemoryBIO *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&b, 'C')) { - _PyArg_BadArgument("write", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("write", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = _ssl_MemoryBIO_write_impl(self, &b); @@ -1089,7 +1089,7 @@ _ssl_RAND_add(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&view, 'C')) { - _PyArg_BadArgument("RAND_add", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("RAND_add", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } } @@ -1283,7 +1283,7 @@ _ssl_txt2obj(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("txt2obj", 1, "txt", "str", args[0]); + _PyArg_BadArgument("txt2obj", 1, "argument 'txt'", "str", args[0]); goto exit; } Py_ssize_t txt_length; @@ -1376,7 +1376,7 @@ _ssl_enum_certificates(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("enum_certificates", 1, "store_name", "str", args[0]); + _PyArg_BadArgument("enum_certificates", 1, "argument 'store_name'", "str", args[0]); goto exit; } Py_ssize_t store_name_length; @@ -1429,7 +1429,7 @@ _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("enum_crls", 1, "store_name", "str", args[0]); + _PyArg_BadArgument("enum_crls", 1, "argument 'store_name'", "str", args[0]); goto exit; } Py_ssize_t store_name_length; @@ -1476,4 +1476,4 @@ _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #ifndef _SSL_ENUM_CRLS_METHODDEF #define _SSL_ENUM_CRLS_METHODDEF #endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */ -/*[clinic end generated code: output=88820c4fd517a256 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7a34c9b61c98c2eb input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_struct.c.h b/Modules/clinic/_struct.c.h index 0143ae930501df..d5756371dd9d92 100644 --- a/Modules/clinic/_struct.c.h +++ b/Modules/clinic/_struct.c.h @@ -65,7 +65,7 @@ Struct_unpack(PyStructObject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("unpack", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = Struct_unpack_impl(self, &buffer); @@ -118,7 +118,7 @@ Struct_unpack_from(PyStructObject *self, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack_from", 1, "buffer", "contiguous buffer", args[0]); + _PyArg_BadArgument("unpack_from", 1, "argument 'buffer'", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -253,7 +253,7 @@ unpack(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack", 2, NULL, "contiguous buffer", args[1]); + _PyArg_BadArgument("unpack", 2, "argument 2", "contiguous buffer", args[1]); goto exit; } return_value = unpack_impl(module, s_object, &buffer); @@ -309,7 +309,7 @@ unpack_from(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack_from", 2, "buffer", "contiguous buffer", args[1]); + _PyArg_BadArgument("unpack_from", 2, "argument 'buffer'", "contiguous buffer", args[1]); goto exit; } if (!noptargs) { @@ -386,4 +386,4 @@ iter_unpack(PyObject *module, PyObject *const *args, Py_ssize_t nargs) return return_value; } -/*[clinic end generated code: output=e1a3a392ad2e2784 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7c2cf3525d53e012 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_tkinter.c.h b/Modules/clinic/_tkinter.c.h index ffe86b9f76ac6f..17304a4270652c 100644 --- a/Modules/clinic/_tkinter.c.h +++ b/Modules/clinic/_tkinter.c.h @@ -20,7 +20,7 @@ _tkinter_tkapp_eval(TkappObject *self, PyObject *arg) const char *script; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("eval", 0, NULL, "str", arg); + _PyArg_BadArgument("eval", 0, "argument", "str", arg); goto exit; } Py_ssize_t script_length; @@ -56,7 +56,7 @@ _tkinter_tkapp_evalfile(TkappObject *self, PyObject *arg) const char *fileName; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("evalfile", 0, NULL, "str", arg); + _PyArg_BadArgument("evalfile", 0, "argument", "str", arg); goto exit; } Py_ssize_t fileName_length; @@ -92,7 +92,7 @@ _tkinter_tkapp_record(TkappObject *self, PyObject *arg) const char *script; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("record", 0, NULL, "str", arg); + _PyArg_BadArgument("record", 0, "argument", "str", arg); goto exit; } Py_ssize_t script_length; @@ -128,7 +128,7 @@ _tkinter_tkapp_adderrorinfo(TkappObject *self, PyObject *arg) const char *msg; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("adderrorinfo", 0, NULL, "str", arg); + _PyArg_BadArgument("adderrorinfo", 0, "argument", "str", arg); goto exit; } Py_ssize_t msg_length; @@ -188,7 +188,7 @@ _tkinter_tkapp_exprstring(TkappObject *self, PyObject *arg) const char *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("exprstring", 0, NULL, "str", arg); + _PyArg_BadArgument("exprstring", 0, "argument", "str", arg); goto exit; } Py_ssize_t s_length; @@ -224,7 +224,7 @@ _tkinter_tkapp_exprlong(TkappObject *self, PyObject *arg) const char *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("exprlong", 0, NULL, "str", arg); + _PyArg_BadArgument("exprlong", 0, "argument", "str", arg); goto exit; } Py_ssize_t s_length; @@ -260,7 +260,7 @@ _tkinter_tkapp_exprdouble(TkappObject *self, PyObject *arg) const char *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("exprdouble", 0, NULL, "str", arg); + _PyArg_BadArgument("exprdouble", 0, "argument", "str", arg); goto exit; } Py_ssize_t s_length; @@ -296,7 +296,7 @@ _tkinter_tkapp_exprboolean(TkappObject *self, PyObject *arg) const char *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("exprboolean", 0, NULL, "str", arg); + _PyArg_BadArgument("exprboolean", 0, "argument", "str", arg); goto exit; } Py_ssize_t s_length; @@ -353,7 +353,7 @@ _tkinter_tkapp_createcommand(TkappObject *self, PyObject *const *args, Py_ssize_ goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("createcommand", 1, NULL, "str", args[0]); + _PyArg_BadArgument("createcommand", 1, "argument 1", "str", args[0]); goto exit; } Py_ssize_t name_length; @@ -390,7 +390,7 @@ _tkinter_tkapp_deletecommand(TkappObject *self, PyObject *arg) const char *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("deletecommand", 0, NULL, "str", arg); + _PyArg_BadArgument("deletecommand", 0, "argument", "str", arg); goto exit; } Py_ssize_t name_length; @@ -731,14 +731,14 @@ _tkinter_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("create", 1, NULL, "str or None", args[0]); + _PyArg_BadArgument("create", 1, "argument 1", "str or None", args[0]); goto exit; } if (nargs < 2) { goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("create", 2, NULL, "str", args[1]); + _PyArg_BadArgument("create", 2, "argument 2", "str", args[1]); goto exit; } Py_ssize_t baseName_length; @@ -754,7 +754,7 @@ _tkinter_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("create", 3, NULL, "str", args[2]); + _PyArg_BadArgument("create", 3, "argument 3", "str", args[2]); goto exit; } Py_ssize_t className_length; @@ -832,7 +832,7 @@ _tkinter_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("create", 8, NULL, "str or None", args[7]); + _PyArg_BadArgument("create", 8, "argument 8", "str or None", args[7]); goto exit; } skip_optional: @@ -912,4 +912,4 @@ _tkinter_getbusywaitinterval(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */ -/*[clinic end generated code: output=1c1c508370348cfa input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c2f9c5e9da1a5c73 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_weakref.c.h b/Modules/clinic/_weakref.c.h index 9effdd0d307ab8..d9746d8cf2d0a9 100644 --- a/Modules/clinic/_weakref.c.h +++ b/Modules/clinic/_weakref.c.h @@ -54,7 +54,7 @@ _weakref__remove_dead_weakref(PyObject *module, PyObject *const *args, Py_ssize_ goto exit; } if (!PyDict_Check(args[0])) { - _PyArg_BadArgument("_remove_dead_weakref", 1, NULL, "dict", args[0]); + _PyArg_BadArgument("_remove_dead_weakref", 1, "argument 1", "dict", args[0]); goto exit; } dct = args[0]; @@ -64,4 +64,4 @@ _weakref__remove_dead_weakref(PyObject *module, PyObject *const *args, Py_ssize_ exit: return return_value; } -/*[clinic end generated code: output=1b199568ba883fb0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0d3c39fed9e01436 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/arraymodule.c.h b/Modules/clinic/arraymodule.c.h index 488925e2be0373..4f4680eb21db43 100644 --- a/Modules/clinic/arraymodule.c.h +++ b/Modules/clinic/arraymodule.c.h @@ -345,7 +345,7 @@ array_array_fromstring(arrayobject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("fromstring", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("fromstring", 0, "argument", "contiguous buffer", arg); goto exit; } } @@ -382,7 +382,7 @@ array_array_frombytes(arrayobject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("frombytes", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("frombytes", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = array_array_frombytes_impl(self, &buffer); @@ -537,14 +537,14 @@ array__array_reconstructor(PyObject *module, PyObject *const *args, Py_ssize_t n } arraytype = (PyTypeObject *)args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("_array_reconstructor", 2, NULL, "a unicode character", args[1]); + _PyArg_BadArgument("_array_reconstructor", 2, "argument 2", "a unicode character", args[1]); goto exit; } if (PyUnicode_READY(args[1])) { goto exit; } if (PyUnicode_GET_LENGTH(args[1]) != 1) { - _PyArg_BadArgument("_array_reconstructor", 2, NULL, "a unicode character", args[1]); + _PyArg_BadArgument("_array_reconstructor", 2, "argument 2", "a unicode character", args[1]); goto exit; } typecode = PyUnicode_READ_CHAR(args[1], 0); @@ -599,4 +599,4 @@ PyDoc_STRVAR(array_arrayiterator___setstate____doc__, #define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \ {"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__}, -/*[clinic end generated code: output=e7e76ee4c4f6d313 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3509df49a81ae0c0 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/audioop.c.h b/Modules/clinic/audioop.c.h index a546ae820691b4..d70d5d691e4f52 100644 --- a/Modules/clinic/audioop.c.h +++ b/Modules/clinic/audioop.c.h @@ -30,7 +30,7 @@ audioop_getsample(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("getsample", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("getsample", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -96,7 +96,7 @@ audioop_max(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("max", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("max", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -145,7 +145,7 @@ audioop_minmax(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("minmax", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("minmax", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -194,7 +194,7 @@ audioop_avg(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("avg", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("avg", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -243,7 +243,7 @@ audioop_rms(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("rms", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("rms", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -293,14 +293,14 @@ audioop_findfit(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("findfit", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("findfit", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &reference, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&reference, 'C')) { - _PyArg_BadArgument("findfit", 2, NULL, "contiguous buffer", args[1]); + _PyArg_BadArgument("findfit", 2, "argument 2", "contiguous buffer", args[1]); goto exit; } return_value = audioop_findfit_impl(module, &fragment, &reference); @@ -345,14 +345,14 @@ audioop_findfactor(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("findfactor", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("findfactor", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &reference, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&reference, 'C')) { - _PyArg_BadArgument("findfactor", 2, NULL, "contiguous buffer", args[1]); + _PyArg_BadArgument("findfactor", 2, "argument 2", "contiguous buffer", args[1]); goto exit; } return_value = audioop_findfactor_impl(module, &fragment, &reference); @@ -397,7 +397,7 @@ audioop_findmax(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("findmax", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("findmax", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -454,7 +454,7 @@ audioop_avgpp(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("avgpp", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("avgpp", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -503,7 +503,7 @@ audioop_maxpp(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("maxpp", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("maxpp", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -552,7 +552,7 @@ audioop_cross(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("cross", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("cross", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -603,7 +603,7 @@ audioop_mul(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("mul", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("mul", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -659,7 +659,7 @@ audioop_tomono(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("tomono", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("tomono", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -719,7 +719,7 @@ audioop_tostereo(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("tostereo", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("tostereo", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -778,14 +778,14 @@ audioop_add(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment1, 'C')) { - _PyArg_BadArgument("add", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("add", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &fragment2, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&fragment2, 'C')) { - _PyArg_BadArgument("add", 2, NULL, "contiguous buffer", args[1]); + _PyArg_BadArgument("add", 2, "argument 2", "contiguous buffer", args[1]); goto exit; } if (PyFloat_Check(args[2])) { @@ -839,7 +839,7 @@ audioop_bias(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("bias", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("bias", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -897,7 +897,7 @@ audioop_reverse(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("reverse", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("reverse", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -946,7 +946,7 @@ audioop_byteswap(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("byteswap", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("byteswap", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -997,7 +997,7 @@ audioop_lin2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("lin2lin", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("lin2lin", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1064,7 +1064,7 @@ audioop_ratecv(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("ratecv", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("ratecv", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1166,7 +1166,7 @@ audioop_lin2ulaw(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("lin2ulaw", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("lin2ulaw", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1215,7 +1215,7 @@ audioop_ulaw2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("ulaw2lin", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("ulaw2lin", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1264,7 +1264,7 @@ audioop_lin2alaw(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("lin2alaw", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("lin2alaw", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1313,7 +1313,7 @@ audioop_alaw2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("alaw2lin", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("alaw2lin", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1364,7 +1364,7 @@ audioop_lin2adpcm(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("lin2adpcm", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("lin2adpcm", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1416,7 +1416,7 @@ audioop_adpcm2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("adpcm2lin", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("adpcm2lin", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1439,4 +1439,4 @@ audioop_adpcm2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) return return_value; } -/*[clinic end generated code: output=19ad2c873a7f1352 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5200371ac4a90260 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/binascii.c.h b/Modules/clinic/binascii.c.h index d114d2bbed0099..a59d13518d40fe 100644 --- a/Modules/clinic/binascii.c.h +++ b/Modules/clinic/binascii.c.h @@ -64,7 +64,7 @@ binascii_b2a_uu(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_uu", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("b2a_uu", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -153,7 +153,7 @@ binascii_b2a_base64(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_base64", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("b2a_base64", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -233,7 +233,7 @@ binascii_rlecode_hqx(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("rlecode_hqx", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("rlecode_hqx", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = binascii_rlecode_hqx_impl(module, &data); @@ -269,7 +269,7 @@ binascii_b2a_hqx(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_hqx", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("b2a_hqx", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = binascii_b2a_hqx_impl(module, &data); @@ -305,7 +305,7 @@ binascii_rledecode_hqx(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("rledecode_hqx", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("rledecode_hqx", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = binascii_rledecode_hqx_impl(module, &data); @@ -346,7 +346,7 @@ binascii_crc_hqx(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("crc_hqx", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("crc_hqx", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -400,7 +400,7 @@ binascii_crc32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("crc32", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("crc32", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -456,7 +456,7 @@ binascii_b2a_hex(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_hex", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("b2a_hex", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = binascii_b2a_hex_impl(module, &data); @@ -494,7 +494,7 @@ binascii_hexlify(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("hexlify", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("hexlify", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = binascii_hexlify_impl(module, &data); @@ -666,7 +666,7 @@ binascii_b2a_qp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_qp", 1, "data", "contiguous buffer", args[0]); + _PyArg_BadArgument("b2a_qp", 1, "argument 'data'", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -720,4 +720,4 @@ binascii_b2a_qp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj return return_value; } -/*[clinic end generated code: output=b75bfb58823158a5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=99ed5c6db16d8d46 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/grpmodule.c.h b/Modules/clinic/grpmodule.c.h index 5debe35b2f32af..bdb29b69cd3ade 100644 --- a/Modules/clinic/grpmodule.c.h +++ b/Modules/clinic/grpmodule.c.h @@ -64,7 +64,7 @@ grp_getgrnam(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("getgrnam", 1, "name", "str", args[0]); + _PyArg_BadArgument("getgrnam", 1, "argument 'name'", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -97,4 +97,4 @@ grp_getgrall(PyObject *module, PyObject *Py_UNUSED(ignored)) { return grp_getgrall_impl(module); } -/*[clinic end generated code: output=4a832b5d8c6c2bcb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fbbc7c6e8b97da5b input=a9049054013a1b77]*/ diff --git a/Modules/clinic/itertoolsmodule.c.h b/Modules/clinic/itertoolsmodule.c.h index 9279c426227d8f..b9e193cbba7d04 100644 --- a/Modules/clinic/itertoolsmodule.c.h +++ b/Modules/clinic/itertoolsmodule.c.h @@ -66,7 +66,7 @@ itertools__grouper(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyObject_TypeCheck(PyTuple_GET_ITEM(args, 0), &groupby_type)) { - _PyArg_BadArgument("_grouper", 1, NULL, (&groupby_type)->tp_name, PyTuple_GET_ITEM(args, 0)); + _PyArg_BadArgument("_grouper", 1, "argument 1", (&groupby_type)->tp_name, PyTuple_GET_ITEM(args, 0)); goto exit; } parent = PyTuple_GET_ITEM(args, 0); @@ -104,7 +104,7 @@ itertools_teedataobject(PyTypeObject *type, PyObject *args, PyObject *kwargs) } it = PyTuple_GET_ITEM(args, 0); if (!PyList_Check(PyTuple_GET_ITEM(args, 1))) { - _PyArg_BadArgument("teedataobject", 2, NULL, "list", PyTuple_GET_ITEM(args, 1)); + _PyArg_BadArgument("teedataobject", 2, "argument 2", "list", PyTuple_GET_ITEM(args, 1)); goto exit; } values = PyTuple_GET_ITEM(args, 1); @@ -642,4 +642,4 @@ itertools_count(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=8998dc0abf2edeeb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a25e6262aa9a157c input=a9049054013a1b77]*/ diff --git a/Modules/clinic/mathmodule.c.h b/Modules/clinic/mathmodule.c.h index 22ae602adaec80..8f6bc144ccb4a7 100644 --- a/Modules/clinic/mathmodule.c.h +++ b/Modules/clinic/mathmodule.c.h @@ -320,12 +320,12 @@ math_dist(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyTuple_Check(args[0])) { - _PyArg_BadArgument("dist", 1, NULL, "tuple", args[0]); + _PyArg_BadArgument("dist", 1, "argument 1", "tuple", args[0]); goto exit; } p = args[0]; if (!PyTuple_Check(args[1])) { - _PyArg_BadArgument("dist", 2, NULL, "tuple", args[1]); + _PyArg_BadArgument("dist", 2, "argument 2", "tuple", args[1]); goto exit; } q = args[1]; @@ -637,4 +637,4 @@ math_prod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k exit: return return_value; } -/*[clinic end generated code: output=d3c6c5c698b5c656 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=14b3770a922a02b9 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index 79efbde0606e6b..55728c12b06034 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -616,7 +616,7 @@ os_chflags(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * goto exit; } if (!PyLong_Check(args[1])) { - _PyArg_BadArgument("chflags", 2, "flags", "int", args[1]); + _PyArg_BadArgument("chflags", 2, "argument 'flags'", "int", args[1]); goto exit; } flags = PyLong_AsUnsignedLongMask(args[1]); @@ -674,7 +674,7 @@ os_lchflags(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyLong_Check(args[1])) { - _PyArg_BadArgument("lchflags", 2, "flags", "int", args[1]); + _PyArg_BadArgument("lchflags", 2, "argument 'flags'", "int", args[1]); goto exit; } flags = PyLong_AsUnsignedLongMask(args[1]); @@ -4969,7 +4969,7 @@ os_write(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("write", 2, NULL, "contiguous buffer", args[1]); + _PyArg_BadArgument("write", 2, "argument 2", "contiguous buffer", args[1]); goto exit; } _return_value = os_write_impl(module, fd, &data); @@ -5292,7 +5292,7 @@ os_pwrite(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("pwrite", 2, NULL, "contiguous buffer", args[1]); + _PyArg_BadArgument("pwrite", 2, "argument 2", "contiguous buffer", args[1]); goto exit; } if (!Py_off_t_converter(args[2], &offset)) { @@ -5923,7 +5923,7 @@ os_putenv(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("putenv", 1, NULL, "str", args[0]); + _PyArg_BadArgument("putenv", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -5931,7 +5931,7 @@ os_putenv(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } name = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("putenv", 2, NULL, "str", args[1]); + _PyArg_BadArgument("putenv", 2, "argument 2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -7127,7 +7127,7 @@ os_setxattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyBuffer_IsContiguous(&value, 'C')) { - _PyArg_BadArgument("setxattr", 3, "value", "contiguous buffer", args[2]); + _PyArg_BadArgument("setxattr", 3, "argument 'value'", "contiguous buffer", args[2]); goto exit; } if (!noptargs) { @@ -8576,4 +8576,4 @@ os__remove_dll_directory(PyObject *module, PyObject *const *args, Py_ssize_t nar #ifndef OS__REMOVE_DLL_DIRECTORY_METHODDEF #define OS__REMOVE_DLL_DIRECTORY_METHODDEF #endif /* !defined(OS__REMOVE_DLL_DIRECTORY_METHODDEF) */ -/*[clinic end generated code: output=22304a47e71b4d0b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0d9b49effa61b7dd input=a9049054013a1b77]*/ diff --git a/Modules/clinic/pwdmodule.c.h b/Modules/clinic/pwdmodule.c.h index 767de9f104a2d3..0ccb714e66627a 100644 --- a/Modules/clinic/pwdmodule.c.h +++ b/Modules/clinic/pwdmodule.c.h @@ -34,7 +34,7 @@ pwd_getpwnam(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("getpwnam", 0, NULL, "str", arg); + _PyArg_BadArgument("getpwnam", 0, "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -74,4 +74,4 @@ pwd_getpwall(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef PWD_GETPWALL_METHODDEF #define PWD_GETPWALL_METHODDEF #endif /* !defined(PWD_GETPWALL_METHODDEF) */ -/*[clinic end generated code: output=b8499e2f717fe79a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2095c61f4cd3c5c2 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/pyexpat.c.h b/Modules/clinic/pyexpat.c.h index 08f6d1eb39e7ab..0165147abe8a9b 100644 --- a/Modules/clinic/pyexpat.c.h +++ b/Modules/clinic/pyexpat.c.h @@ -75,7 +75,7 @@ pyexpat_xmlparser_SetBase(xmlparseobject *self, PyObject *arg) const char *base; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("SetBase", 0, NULL, "str", arg); + _PyArg_BadArgument("SetBase", 0, "argument", "str", arg); goto exit; } Py_ssize_t base_length; @@ -171,14 +171,14 @@ pyexpat_xmlparser_ExternalEntityParserCreate(xmlparseobject *self, PyObject *con } } else { - _PyArg_BadArgument("ExternalEntityParserCreate", 1, NULL, "str or None", args[0]); + _PyArg_BadArgument("ExternalEntityParserCreate", 1, "argument 1", "str or None", args[0]); goto exit; } if (nargs < 2) { goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("ExternalEntityParserCreate", 2, NULL, "str", args[1]); + _PyArg_BadArgument("ExternalEntityParserCreate", 2, "argument 2", "str", args[1]); goto exit; } Py_ssize_t encoding_length; @@ -327,7 +327,7 @@ pyexpat_ParserCreate(PyObject *module, PyObject *const *args, Py_ssize_t nargs, } } else { - _PyArg_BadArgument("ParserCreate", 1, "encoding", "str or None", args[0]); + _PyArg_BadArgument("ParserCreate", 1, "argument 'encoding'", "str or None", args[0]); goto exit; } if (!--noptargs) { @@ -350,7 +350,7 @@ pyexpat_ParserCreate(PyObject *module, PyObject *const *args, Py_ssize_t nargs, } } else { - _PyArg_BadArgument("ParserCreate", 2, "namespace_separator", "str or None", args[1]); + _PyArg_BadArgument("ParserCreate", 2, "argument 'namespace_separator'", "str or None", args[1]); goto exit; } if (!--noptargs) { @@ -401,4 +401,4 @@ pyexpat_ErrorString(PyObject *module, PyObject *arg) #ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */ -/*[clinic end generated code: output=ff349caaedfd9375 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4d2fd19723be47af input=a9049054013a1b77]*/ diff --git a/Modules/clinic/signalmodule.c.h b/Modules/clinic/signalmodule.c.h index 3bafdff83ce2db..6c2a683a1a7574 100644 --- a/Modules/clinic/signalmodule.c.h +++ b/Modules/clinic/signalmodule.c.h @@ -590,7 +590,7 @@ signal_pthread_kill(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyLong_Check(args[0])) { - _PyArg_BadArgument("pthread_kill", 1, NULL, "int", args[0]); + _PyArg_BadArgument("pthread_kill", 1, "argument 1", "int", args[0]); goto exit; } thread_id = PyLong_AsUnsignedLongMask(args[0]); @@ -658,4 +658,4 @@ signal_pthread_kill(PyObject *module, PyObject *const *args, Py_ssize_t nargs) #ifndef SIGNAL_PTHREAD_KILL_METHODDEF #define SIGNAL_PTHREAD_KILL_METHODDEF #endif /* !defined(SIGNAL_PTHREAD_KILL_METHODDEF) */ -/*[clinic end generated code: output=9c989d16aadc9afb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fdf88e367462e012 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/spwdmodule.c.h b/Modules/clinic/spwdmodule.c.h index c386e34cd4ae8a..a76281bb125c1d 100644 --- a/Modules/clinic/spwdmodule.c.h +++ b/Modules/clinic/spwdmodule.c.h @@ -25,7 +25,7 @@ spwd_getspnam(PyObject *module, PyObject *arg_) PyObject *arg; if (!PyUnicode_Check(arg_)) { - _PyArg_BadArgument("getspnam", 0, NULL, "str", arg_); + _PyArg_BadArgument("getspnam", 0, "argument", "str", arg_); goto exit; } if (PyUnicode_READY(arg_) == -1) { @@ -71,4 +71,4 @@ spwd_getspall(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef SPWD_GETSPALL_METHODDEF #define SPWD_GETSPALL_METHODDEF #endif /* !defined(SPWD_GETSPALL_METHODDEF) */ -/*[clinic end generated code: output=c7a506015f61bd90 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=8edc96053285c7d9 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/symtablemodule.c.h b/Modules/clinic/symtablemodule.c.h index 85a0334f23cd92..6968af1722183b 100644 --- a/Modules/clinic/symtablemodule.c.h +++ b/Modules/clinic/symtablemodule.c.h @@ -31,7 +31,7 @@ _symtable_symtable(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("symtable", 3, NULL, "str", args[2]); + _PyArg_BadArgument("symtable", 3, "argument 3", "str", args[2]); goto exit; } Py_ssize_t startstr_length; @@ -48,4 +48,4 @@ _symtable_symtable(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=f72e865ab32160db input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2184de982b72c175 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/unicodedata.c.h b/Modules/clinic/unicodedata.c.h index 9cb51e59e8d010..1a6cd93daa3c9b 100644 --- a/Modules/clinic/unicodedata.c.h +++ b/Modules/clinic/unicodedata.c.h @@ -30,14 +30,14 @@ unicodedata_UCD_decimal(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("decimal", 1, NULL, "a unicode character", args[0]); + _PyArg_BadArgument("decimal", 1, "argument 1", "a unicode character", args[0]); goto exit; } if (PyUnicode_READY(args[0])) { goto exit; } if (PyUnicode_GET_LENGTH(args[0]) != 1) { - _PyArg_BadArgument("decimal", 1, NULL, "a unicode character", args[0]); + _PyArg_BadArgument("decimal", 1, "argument 1", "a unicode character", args[0]); goto exit; } chr = PyUnicode_READ_CHAR(args[0], 0); @@ -79,14 +79,14 @@ unicodedata_UCD_digit(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("digit", 1, NULL, "a unicode character", args[0]); + _PyArg_BadArgument("digit", 1, "argument 1", "a unicode character", args[0]); goto exit; } if (PyUnicode_READY(args[0])) { goto exit; } if (PyUnicode_GET_LENGTH(args[0]) != 1) { - _PyArg_BadArgument("digit", 1, NULL, "a unicode character", args[0]); + _PyArg_BadArgument("digit", 1, "argument 1", "a unicode character", args[0]); goto exit; } chr = PyUnicode_READ_CHAR(args[0], 0); @@ -129,14 +129,14 @@ unicodedata_UCD_numeric(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("numeric", 1, NULL, "a unicode character", args[0]); + _PyArg_BadArgument("numeric", 1, "argument 1", "a unicode character", args[0]); goto exit; } if (PyUnicode_READY(args[0])) { goto exit; } if (PyUnicode_GET_LENGTH(args[0]) != 1) { - _PyArg_BadArgument("numeric", 1, NULL, "a unicode character", args[0]); + _PyArg_BadArgument("numeric", 1, "argument 1", "a unicode character", args[0]); goto exit; } chr = PyUnicode_READ_CHAR(args[0], 0); @@ -170,14 +170,14 @@ unicodedata_UCD_category(PyObject *self, PyObject *arg) int chr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("category", 0, NULL, "a unicode character", arg); + _PyArg_BadArgument("category", 0, "argument", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("category", 0, NULL, "a unicode character", arg); + _PyArg_BadArgument("category", 0, "argument", "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -208,14 +208,14 @@ unicodedata_UCD_bidirectional(PyObject *self, PyObject *arg) int chr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("bidirectional", 0, NULL, "a unicode character", arg); + _PyArg_BadArgument("bidirectional", 0, "argument", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("bidirectional", 0, NULL, "a unicode character", arg); + _PyArg_BadArgument("bidirectional", 0, "argument", "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -247,14 +247,14 @@ unicodedata_UCD_combining(PyObject *self, PyObject *arg) int _return_value; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("combining", 0, NULL, "a unicode character", arg); + _PyArg_BadArgument("combining", 0, "argument", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("combining", 0, NULL, "a unicode character", arg); + _PyArg_BadArgument("combining", 0, "argument", "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -291,14 +291,14 @@ unicodedata_UCD_mirrored(PyObject *self, PyObject *arg) int _return_value; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("mirrored", 0, NULL, "a unicode character", arg); + _PyArg_BadArgument("mirrored", 0, "argument", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("mirrored", 0, NULL, "a unicode character", arg); + _PyArg_BadArgument("mirrored", 0, "argument", "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -331,14 +331,14 @@ unicodedata_UCD_east_asian_width(PyObject *self, PyObject *arg) int chr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("east_asian_width", 0, NULL, "a unicode character", arg); + _PyArg_BadArgument("east_asian_width", 0, "argument", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("east_asian_width", 0, NULL, "a unicode character", arg); + _PyArg_BadArgument("east_asian_width", 0, "argument", "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -369,14 +369,14 @@ unicodedata_UCD_decomposition(PyObject *self, PyObject *arg) int chr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("decomposition", 0, NULL, "a unicode character", arg); + _PyArg_BadArgument("decomposition", 0, "argument", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("decomposition", 0, NULL, "a unicode character", arg); + _PyArg_BadArgument("decomposition", 0, "argument", "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -412,7 +412,7 @@ unicodedata_UCD_is_normalized(PyObject *self, PyObject *const *args, Py_ssize_t goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("is_normalized", 1, NULL, "str", args[0]); + _PyArg_BadArgument("is_normalized", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -420,7 +420,7 @@ unicodedata_UCD_is_normalized(PyObject *self, PyObject *const *args, Py_ssize_t } form = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("is_normalized", 2, NULL, "str", args[1]); + _PyArg_BadArgument("is_normalized", 2, "argument 2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -459,7 +459,7 @@ unicodedata_UCD_normalize(PyObject *self, PyObject *const *args, Py_ssize_t narg goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("normalize", 1, NULL, "str", args[0]); + _PyArg_BadArgument("normalize", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -467,7 +467,7 @@ unicodedata_UCD_normalize(PyObject *self, PyObject *const *args, Py_ssize_t narg } form = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("normalize", 2, NULL, "str", args[1]); + _PyArg_BadArgument("normalize", 2, "argument 2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -506,14 +506,14 @@ unicodedata_UCD_name(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("name", 1, NULL, "a unicode character", args[0]); + _PyArg_BadArgument("name", 1, "argument 1", "a unicode character", args[0]); goto exit; } if (PyUnicode_READY(args[0])) { goto exit; } if (PyUnicode_GET_LENGTH(args[0]) != 1) { - _PyArg_BadArgument("name", 1, NULL, "a unicode character", args[0]); + _PyArg_BadArgument("name", 1, "argument 1", "a unicode character", args[0]); goto exit; } chr = PyUnicode_READ_CHAR(args[0], 0); @@ -559,4 +559,4 @@ unicodedata_UCD_lookup(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=4a9758579adebc95 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7d09237084a0b1f2 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/zlibmodule.c.h b/Modules/clinic/zlibmodule.c.h index 41de47cfed2d51..08c184f9579235 100644 --- a/Modules/clinic/zlibmodule.c.h +++ b/Modules/clinic/zlibmodule.c.h @@ -38,7 +38,7 @@ zlib_compress(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("compress", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("compress", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -105,7 +105,7 @@ zlib_decompress(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("decompress", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("decompress", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -273,7 +273,7 @@ zlib_compressobj(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb goto exit; } if (!PyBuffer_IsContiguous(&zdict, 'C')) { - _PyArg_BadArgument("compressobj", 6, "zdict", "contiguous buffer", args[5]); + _PyArg_BadArgument("compressobj", 6, "argument 'zdict'", "contiguous buffer", args[5]); goto exit; } skip_optional_pos: @@ -375,7 +375,7 @@ zlib_Compress_compress(compobject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("compress", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("compress", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = zlib_Compress_compress_impl(self, &data); @@ -432,7 +432,7 @@ zlib_Decompress_decompress(compobject *self, PyObject *const *args, Py_ssize_t n goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("decompress", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("decompress", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -677,7 +677,7 @@ zlib_adler32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("adler32", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("adler32", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -735,7 +735,7 @@ zlib_crc32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("crc32", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("crc32", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -785,4 +785,4 @@ zlib_crc32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) #ifndef ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF #define ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF #endif /* !defined(ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF) */ -/*[clinic end generated code: output=d0bfacbb4ce266fa input=a9049054013a1b77]*/ +/*[clinic end generated code: output=775a594fa952259e input=a9049054013a1b77]*/ diff --git a/Objects/clinic/bytearrayobject.c.h b/Objects/clinic/bytearrayobject.c.h index 10e2bceb9fea2b..c92912dd11fcc4 100644 --- a/Objects/clinic/bytearrayobject.c.h +++ b/Objects/clinic/bytearrayobject.c.h @@ -115,14 +115,14 @@ bytearray_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&frm, 'C')) { - _PyArg_BadArgument("maketrans", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("maketrans", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &to, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&to, 'C')) { - _PyArg_BadArgument("maketrans", 2, NULL, "contiguous buffer", args[1]); + _PyArg_BadArgument("maketrans", 2, "argument 2", "contiguous buffer", args[1]); goto exit; } return_value = bytearray_maketrans_impl(&frm, &to); @@ -175,14 +175,14 @@ bytearray_replace(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&old, 'C')) { - _PyArg_BadArgument("replace", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("replace", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &new, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&new, 'C')) { - _PyArg_BadArgument("replace", 2, NULL, "contiguous buffer", args[1]); + _PyArg_BadArgument("replace", 2, "argument 2", "contiguous buffer", args[1]); goto exit; } if (nargs < 3) { @@ -735,7 +735,7 @@ bytearray_decode(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t narg } if (args[0]) { if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("decode", 1, "encoding", "str", args[0]); + _PyArg_BadArgument("decode", 1, "argument 'encoding'", "str", args[0]); goto exit; } Py_ssize_t encoding_length; @@ -752,7 +752,7 @@ bytearray_decode(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t narg } } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("decode", 2, "errors", "str", args[1]); + _PyArg_BadArgument("decode", 2, "argument 'errors'", "str", args[1]); goto exit; } Py_ssize_t errors_length; @@ -854,7 +854,7 @@ bytearray_fromhex(PyTypeObject *type, PyObject *arg) PyObject *string; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("fromhex", 0, NULL, "str", arg); + _PyArg_BadArgument("fromhex", 0, "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -942,4 +942,4 @@ bytearray_sizeof(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored)) { return bytearray_sizeof_impl(self); } -/*[clinic end generated code: output=05e4e168c88d7565 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dfa47342816053ca input=a9049054013a1b77]*/ diff --git a/Objects/clinic/bytesobject.c.h b/Objects/clinic/bytesobject.c.h index 9987a895652e08..1cb10ebed4c821 100644 --- a/Objects/clinic/bytesobject.c.h +++ b/Objects/clinic/bytesobject.c.h @@ -99,7 +99,7 @@ bytes_partition(PyBytesObject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&sep, 'C')) { - _PyArg_BadArgument("partition", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("partition", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = bytes_partition_impl(self, &sep); @@ -142,7 +142,7 @@ bytes_rpartition(PyBytesObject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&sep, 'C')) { - _PyArg_BadArgument("rpartition", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("rpartition", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = bytes_rpartition_impl(self, &sep); @@ -420,14 +420,14 @@ bytes_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&frm, 'C')) { - _PyArg_BadArgument("maketrans", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("maketrans", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &to, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&to, 'C')) { - _PyArg_BadArgument("maketrans", 2, NULL, "contiguous buffer", args[1]); + _PyArg_BadArgument("maketrans", 2, "argument 2", "contiguous buffer", args[1]); goto exit; } return_value = bytes_maketrans_impl(&frm, &to); @@ -480,14 +480,14 @@ bytes_replace(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&old, 'C')) { - _PyArg_BadArgument("replace", 1, NULL, "contiguous buffer", args[0]); + _PyArg_BadArgument("replace", 1, "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &new, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&new, 'C')) { - _PyArg_BadArgument("replace", 2, NULL, "contiguous buffer", args[1]); + _PyArg_BadArgument("replace", 2, "argument 2", "contiguous buffer", args[1]); goto exit; } if (nargs < 3) { @@ -568,7 +568,7 @@ bytes_decode(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObj } if (args[0]) { if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("decode", 1, "encoding", "str", args[0]); + _PyArg_BadArgument("decode", 1, "argument 'encoding'", "str", args[0]); goto exit; } Py_ssize_t encoding_length; @@ -585,7 +585,7 @@ bytes_decode(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObj } } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("decode", 2, "errors", "str", args[1]); + _PyArg_BadArgument("decode", 2, "argument 'errors'", "str", args[1]); goto exit; } Py_ssize_t errors_length; @@ -674,7 +674,7 @@ bytes_fromhex(PyTypeObject *type, PyObject *arg) PyObject *string; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("fromhex", 0, NULL, "str", arg); + _PyArg_BadArgument("fromhex", 0, "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -686,4 +686,4 @@ bytes_fromhex(PyTypeObject *type, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=852535b3ae0b8cdb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f74ee04e5192e286 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/codeobject.c.h b/Objects/clinic/codeobject.c.h index 6c26732bd48667..2dc7ae2b319f58 100644 --- a/Objects/clinic/codeobject.c.h +++ b/Objects/clinic/codeobject.c.h @@ -158,7 +158,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[7]) { if (!PyBytes_Check(args[7])) { - _PyArg_BadArgument("replace", 8, "co_code", "bytes", args[7]); + _PyArg_BadArgument("replace", 8, "argument 'co_code'", "bytes", args[7]); goto exit; } co_code = (PyBytesObject *)args[7]; @@ -168,7 +168,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[8]) { if (!PyTuple_Check(args[8])) { - _PyArg_BadArgument("replace", 9, "co_consts", "tuple", args[8]); + _PyArg_BadArgument("replace", 9, "argument 'co_consts'", "tuple", args[8]); goto exit; } co_consts = args[8]; @@ -178,7 +178,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[9]) { if (!PyTuple_Check(args[9])) { - _PyArg_BadArgument("replace", 10, "co_names", "tuple", args[9]); + _PyArg_BadArgument("replace", 10, "argument 'co_names'", "tuple", args[9]); goto exit; } co_names = args[9]; @@ -188,7 +188,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[10]) { if (!PyTuple_Check(args[10])) { - _PyArg_BadArgument("replace", 11, "co_varnames", "tuple", args[10]); + _PyArg_BadArgument("replace", 11, "argument 'co_varnames'", "tuple", args[10]); goto exit; } co_varnames = args[10]; @@ -198,7 +198,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[11]) { if (!PyTuple_Check(args[11])) { - _PyArg_BadArgument("replace", 12, "co_freevars", "tuple", args[11]); + _PyArg_BadArgument("replace", 12, "argument 'co_freevars'", "tuple", args[11]); goto exit; } co_freevars = args[11]; @@ -208,7 +208,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[12]) { if (!PyTuple_Check(args[12])) { - _PyArg_BadArgument("replace", 13, "co_cellvars", "tuple", args[12]); + _PyArg_BadArgument("replace", 13, "argument 'co_cellvars'", "tuple", args[12]); goto exit; } co_cellvars = args[12]; @@ -218,7 +218,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[13]) { if (!PyUnicode_Check(args[13])) { - _PyArg_BadArgument("replace", 14, "co_filename", "str", args[13]); + _PyArg_BadArgument("replace", 14, "argument 'co_filename'", "str", args[13]); goto exit; } if (PyUnicode_READY(args[13]) == -1) { @@ -231,7 +231,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[14]) { if (!PyUnicode_Check(args[14])) { - _PyArg_BadArgument("replace", 15, "co_name", "str", args[14]); + _PyArg_BadArgument("replace", 15, "argument 'co_name'", "str", args[14]); goto exit; } if (PyUnicode_READY(args[14]) == -1) { @@ -243,7 +243,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } } if (!PyBytes_Check(args[15])) { - _PyArg_BadArgument("replace", 16, "co_lnotab", "bytes", args[15]); + _PyArg_BadArgument("replace", 16, "argument 'co_lnotab'", "bytes", args[15]); goto exit; } co_lnotab = (PyBytesObject *)args[15]; @@ -253,4 +253,4 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje exit: return return_value; } -/*[clinic end generated code: output=a9c21d66b7513a60 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b4b7c0d522e75335 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/floatobject.c.h b/Objects/clinic/floatobject.c.h index 9bea9f403ad523..893f8d306c5442 100644 --- a/Objects/clinic/floatobject.c.h +++ b/Objects/clinic/floatobject.c.h @@ -235,7 +235,7 @@ float___getformat__(PyTypeObject *type, PyObject *arg) const char *typestr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__getformat__", 0, NULL, "str", arg); + _PyArg_BadArgument("__getformat__", 0, "argument", "str", arg); goto exit; } Py_ssize_t typestr_length; @@ -289,7 +289,7 @@ float___set_format__(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("__set_format__", 1, NULL, "str", args[0]); + _PyArg_BadArgument("__set_format__", 1, "argument 1", "str", args[0]); goto exit; } Py_ssize_t typestr_length; @@ -302,7 +302,7 @@ float___set_format__(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("__set_format__", 2, NULL, "str", args[1]); + _PyArg_BadArgument("__set_format__", 2, "argument 2", "str", args[1]); goto exit; } Py_ssize_t fmt_length; @@ -339,7 +339,7 @@ float___format__(PyObject *self, PyObject *arg) PyObject *format_spec; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__format__", 0, NULL, "str", arg); + _PyArg_BadArgument("__format__", 0, "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -351,4 +351,4 @@ float___format__(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=84b2b5cd8178e797 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=40b435f5108eb792 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/funcobject.c.h b/Objects/clinic/funcobject.c.h index 8ccf9a60a790f8..0ea5e96e931651 100644 --- a/Objects/clinic/funcobject.c.h +++ b/Objects/clinic/funcobject.c.h @@ -44,12 +44,12 @@ func_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyObject_TypeCheck(fastargs[0], &PyCode_Type)) { - _PyArg_BadArgument("function", 1, "code", (&PyCode_Type)->tp_name, fastargs[0]); + _PyArg_BadArgument("function", 1, "argument 'code'", (&PyCode_Type)->tp_name, fastargs[0]); goto exit; } code = (PyCodeObject *)fastargs[0]; if (!PyDict_Check(fastargs[1])) { - _PyArg_BadArgument("function", 2, "globals", "dict", fastargs[1]); + _PyArg_BadArgument("function", 2, "argument 'globals'", "dict", fastargs[1]); goto exit; } globals = fastargs[1]; @@ -75,4 +75,4 @@ func_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=3c5859ec33df1021 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3ce3d2c5cbfb7314 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/longobject.c.h b/Objects/clinic/longobject.c.h index bc03c907addcb3..59d5d30eeac19f 100644 --- a/Objects/clinic/longobject.c.h +++ b/Objects/clinic/longobject.c.h @@ -74,7 +74,7 @@ int___format__(PyObject *self, PyObject *arg) PyObject *format_spec; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__format__", 0, NULL, "str", arg); + _PyArg_BadArgument("__format__", 0, "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -227,7 +227,7 @@ int_to_bytes(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject * length = ival; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("to_bytes", 2, "byteorder", "str", args[1]); + _PyArg_BadArgument("to_bytes", 2, "argument 'byteorder'", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -293,7 +293,7 @@ int_from_bytes(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs, PyOb } bytes_obj = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("from_bytes", 2, "byteorder", "str", args[1]); + _PyArg_BadArgument("from_bytes", 2, "argument 'byteorder'", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -313,4 +313,4 @@ int_from_bytes(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs, PyOb exit: return return_value; } -/*[clinic end generated code: output=6b27b1f015ff54d5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=05b782a0f235b5d2 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/moduleobject.c.h b/Objects/clinic/moduleobject.c.h index ebb891bc0f3be8..ddc125ccabdb00 100644 --- a/Objects/clinic/moduleobject.c.h +++ b/Objects/clinic/moduleobject.c.h @@ -31,7 +31,7 @@ module___init__(PyObject *self, PyObject *args, PyObject *kwargs) goto exit; } if (!PyUnicode_Check(fastargs[0])) { - _PyArg_BadArgument("module", 1, "name", "str", fastargs[0]); + _PyArg_BadArgument("module", 1, "argument 'name'", "str", fastargs[0]); goto exit; } if (PyUnicode_READY(fastargs[0]) == -1) { @@ -48,4 +48,4 @@ module___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=9b65f8ef68a2932e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=531c1d681a0ca036 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/typeobject.c.h b/Objects/clinic/typeobject.c.h index c64f68eefefc76..19bee130fdb93d 100644 --- a/Objects/clinic/typeobject.c.h +++ b/Objects/clinic/typeobject.c.h @@ -200,7 +200,7 @@ object___format__(PyObject *self, PyObject *arg) PyObject *format_spec; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__format__", 0, NULL, "str", arg); + _PyArg_BadArgument("__format__", 0, "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -248,4 +248,4 @@ object___dir__(PyObject *self, PyObject *Py_UNUSED(ignored)) { return object___dir___impl(self); } -/*[clinic end generated code: output=bb04310c1ce00d90 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f6b2e2a0c71b5664 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/unicodeobject.c.h b/Objects/clinic/unicodeobject.c.h index 33cba3ec11a07a..2c4649b67c5d8b 100644 --- a/Objects/clinic/unicodeobject.c.h +++ b/Objects/clinic/unicodeobject.c.h @@ -157,7 +157,7 @@ unicode_encode(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject } if (args[0]) { if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("encode", 1, "encoding", "str", args[0]); + _PyArg_BadArgument("encode", 1, "argument 'encoding'", "str", args[0]); goto exit; } Py_ssize_t encoding_length; @@ -174,7 +174,7 @@ unicode_encode(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject } } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("encode", 2, "errors", "str", args[1]); + _PyArg_BadArgument("encode", 2, "argument 'errors'", "str", args[1]); goto exit; } Py_ssize_t errors_length; @@ -712,7 +712,7 @@ unicode_replace(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("replace", 1, NULL, "str", args[0]); + _PyArg_BadArgument("replace", 1, "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -720,7 +720,7 @@ unicode_replace(PyObject *self, PyObject *const *args, Py_ssize_t nargs) } old = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("replace", 2, NULL, "str", args[1]); + _PyArg_BadArgument("replace", 2, "argument 2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -1080,7 +1080,7 @@ unicode_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("maketrans", 2, NULL, "str", args[1]); + _PyArg_BadArgument("maketrans", 2, "argument 2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -1091,7 +1091,7 @@ unicode_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("maketrans", 3, NULL, "str", args[2]); + _PyArg_BadArgument("maketrans", 3, "argument 3", "str", args[2]); goto exit; } if (PyUnicode_READY(args[2]) == -1) { @@ -1202,7 +1202,7 @@ unicode___format__(PyObject *self, PyObject *arg) PyObject *format_spec; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__format__", 0, NULL, "str", arg); + _PyArg_BadArgument("__format__", 0, "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -1232,4 +1232,4 @@ unicode_sizeof(PyObject *self, PyObject *Py_UNUSED(ignored)) { return unicode_sizeof_impl(self); } -/*[clinic end generated code: output=1614a54b592397f6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ac54f48ebafcf526 input=a9049054013a1b77]*/ diff --git a/Objects/stringlib/clinic/transmogrify.h.h b/Objects/stringlib/clinic/transmogrify.h.h index 4bc21a161a8af8..f903ec239d74cc 100644 --- a/Objects/stringlib/clinic/transmogrify.h.h +++ b/Objects/stringlib/clinic/transmogrify.h.h @@ -100,7 +100,7 @@ stringlib_ljust(PyObject *self, PyObject *const *args, Py_ssize_t nargs) fillchar = PyByteArray_AS_STRING(args[1])[0]; } else { - _PyArg_BadArgument("ljust", 2, NULL, "a byte string of length 1", args[1]); + _PyArg_BadArgument("ljust", 2, "argument 2", "a byte string of length 1", args[1]); goto exit; } skip_optional: @@ -161,7 +161,7 @@ stringlib_rjust(PyObject *self, PyObject *const *args, Py_ssize_t nargs) fillchar = PyByteArray_AS_STRING(args[1])[0]; } else { - _PyArg_BadArgument("rjust", 2, NULL, "a byte string of length 1", args[1]); + _PyArg_BadArgument("rjust", 2, "argument 2", "a byte string of length 1", args[1]); goto exit; } skip_optional: @@ -222,7 +222,7 @@ stringlib_center(PyObject *self, PyObject *const *args, Py_ssize_t nargs) fillchar = PyByteArray_AS_STRING(args[1])[0]; } else { - _PyArg_BadArgument("center", 2, NULL, "a byte string of length 1", args[1]); + _PyArg_BadArgument("center", 2, "argument 2", "a byte string of length 1", args[1]); goto exit; } skip_optional: @@ -274,4 +274,4 @@ stringlib_zfill(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=c416ebfb732f8184 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=12ba03626b7614b2 input=a9049054013a1b77]*/ diff --git a/PC/clinic/_testconsole.c.h b/PC/clinic/_testconsole.c.h index 63f580c0bf963c..3dad7b39b14a9e 100644 --- a/PC/clinic/_testconsole.c.h +++ b/PC/clinic/_testconsole.c.h @@ -33,7 +33,7 @@ _testconsole_write_input(PyObject *module, PyObject *const *args, Py_ssize_t nar } file = args[0]; if (!PyBytes_Check(args[1])) { - _PyArg_BadArgument("write_input", 2, "s", "bytes", args[1]); + _PyArg_BadArgument("write_input", 2, "argument 's'", "bytes", args[1]); goto exit; } s = (PyBytesObject *)args[1]; @@ -88,4 +88,4 @@ _testconsole_read_output(PyObject *module, PyObject *const *args, Py_ssize_t nar #ifndef _TESTCONSOLE_READ_OUTPUT_METHODDEF #define _TESTCONSOLE_READ_OUTPUT_METHODDEF #endif /* !defined(_TESTCONSOLE_READ_OUTPUT_METHODDEF) */ -/*[clinic end generated code: output=ccf0c449053656a6 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4e9531cf03b5c7ae input=a9049054013a1b77]*/ diff --git a/PC/clinic/msvcrtmodule.c.h b/PC/clinic/msvcrtmodule.c.h index ac64a177dcd1db..ffe9090a69c42a 100644 --- a/PC/clinic/msvcrtmodule.c.h +++ b/PC/clinic/msvcrtmodule.c.h @@ -375,7 +375,7 @@ msvcrt_putch(PyObject *module, PyObject *arg) char_value = PyByteArray_AS_STRING(arg)[0]; } else { - _PyArg_BadArgument("putch", 0, NULL, "a byte string of length 1", arg); + _PyArg_BadArgument("putch", 0, "argument", "a byte string of length 1", arg); goto exit; } return_value = msvcrt_putch_impl(module, char_value); @@ -403,14 +403,14 @@ msvcrt_putwch(PyObject *module, PyObject *arg) int unicode_char; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("putwch", 0, NULL, "a unicode character", arg); + _PyArg_BadArgument("putwch", 0, "argument", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("putwch", 0, NULL, "a unicode character", arg); + _PyArg_BadArgument("putwch", 0, "argument", "a unicode character", arg); goto exit; } unicode_char = PyUnicode_READ_CHAR(arg, 0); @@ -449,7 +449,7 @@ msvcrt_ungetch(PyObject *module, PyObject *arg) char_value = PyByteArray_AS_STRING(arg)[0]; } else { - _PyArg_BadArgument("ungetch", 0, NULL, "a byte string of length 1", arg); + _PyArg_BadArgument("ungetch", 0, "argument", "a byte string of length 1", arg); goto exit; } return_value = msvcrt_ungetch_impl(module, char_value); @@ -477,14 +477,14 @@ msvcrt_ungetwch(PyObject *module, PyObject *arg) int unicode_char; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("ungetwch", 0, NULL, "a unicode character", arg); + _PyArg_BadArgument("ungetwch", 0, "argument", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("ungetwch", 0, NULL, "a unicode character", arg); + _PyArg_BadArgument("ungetwch", 0, "argument", "a unicode character", arg); goto exit; } unicode_char = PyUnicode_READ_CHAR(arg, 0); @@ -679,4 +679,4 @@ msvcrt_SetErrorMode(PyObject *module, PyObject *arg) #ifndef MSVCRT_SET_ERROR_MODE_METHODDEF #define MSVCRT_SET_ERROR_MODE_METHODDEF #endif /* !defined(MSVCRT_SET_ERROR_MODE_METHODDEF) */ -/*[clinic end generated code: output=e4d2e881b8cf0de7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7c498a598dc9a5a5 input=a9049054013a1b77]*/ diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h index 5354166abfff18..6ef30b0739f1ba 100644 --- a/Python/clinic/bltinmodule.c.h +++ b/Python/clinic/bltinmodule.c.h @@ -102,7 +102,7 @@ builtin_format(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("format", 2, NULL, "str", args[1]); + _PyArg_BadArgument("format", 2, "argument 2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -200,7 +200,7 @@ builtin_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("compile", 3, "mode", "str", args[2]); + _PyArg_BadArgument("compile", 3, "argument 'mode'", "str", args[2]); goto exit; } Py_ssize_t mode_length; @@ -845,4 +845,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=183d8cbb521432fe input=a9049054013a1b77]*/ +/*[clinic end generated code: output=cdfc262b33cfbb30 input=a9049054013a1b77]*/ diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h index 1731235dff9e3e..36d206328cd62c 100644 --- a/Python/clinic/import.c.h +++ b/Python/clinic/import.c.h @@ -92,12 +92,12 @@ _imp__fix_co_filename(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyObject_TypeCheck(args[0], &PyCode_Type)) { - _PyArg_BadArgument("_fix_co_filename", 1, NULL, (&PyCode_Type)->tp_name, args[0]); + _PyArg_BadArgument("_fix_co_filename", 1, "argument 1", (&PyCode_Type)->tp_name, args[0]); goto exit; } code = (PyCodeObject *)args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("_fix_co_filename", 2, NULL, "str", args[1]); + _PyArg_BadArgument("_fix_co_filename", 2, "argument 2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -156,7 +156,7 @@ _imp_init_frozen(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("init_frozen", 0, NULL, "str", arg); + _PyArg_BadArgument("init_frozen", 0, "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -188,7 +188,7 @@ _imp_get_frozen_object(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("get_frozen_object", 0, NULL, "str", arg); + _PyArg_BadArgument("get_frozen_object", 0, "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -220,7 +220,7 @@ _imp_is_frozen_package(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("is_frozen_package", 0, NULL, "str", arg); + _PyArg_BadArgument("is_frozen_package", 0, "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -252,7 +252,7 @@ _imp_is_builtin(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("is_builtin", 0, NULL, "str", arg); + _PyArg_BadArgument("is_builtin", 0, "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -284,7 +284,7 @@ _imp_is_frozen(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("is_frozen", 0, NULL, "str", arg); + _PyArg_BadArgument("is_frozen", 0, "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -433,7 +433,7 @@ _imp_source_hash(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb goto exit; } if (!PyBuffer_IsContiguous(&source, 'C')) { - _PyArg_BadArgument("source_hash", 2, "source", "contiguous buffer", args[1]); + _PyArg_BadArgument("source_hash", 2, "argument 'source'", "contiguous buffer", args[1]); goto exit; } return_value = _imp_source_hash_impl(module, key, &source); @@ -454,4 +454,4 @@ _imp_source_hash(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #ifndef _IMP_EXEC_DYNAMIC_METHODDEF #define _IMP_EXEC_DYNAMIC_METHODDEF #endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */ -/*[clinic end generated code: output=d1baf0a8f43bf0c2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0ecaa2acf655f438 input=a9049054013a1b77]*/ diff --git a/Python/clinic/marshal.c.h b/Python/clinic/marshal.c.h index cc372cf7106884..19f4a4e18d0ed7 100644 --- a/Python/clinic/marshal.c.h +++ b/Python/clinic/marshal.c.h @@ -152,7 +152,7 @@ marshal_loads(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&bytes, 'C')) { - _PyArg_BadArgument("loads", 0, NULL, "contiguous buffer", arg); + _PyArg_BadArgument("loads", 0, "argument", "contiguous buffer", arg); goto exit; } return_value = marshal_loads_impl(module, &bytes); @@ -165,4 +165,4 @@ marshal_loads(PyObject *module, PyObject *arg) return return_value; } -/*[clinic end generated code: output=92cf7faf9b57dbae input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6ccb3aceb30ac9b0 input=a9049054013a1b77]*/ diff --git a/Python/clinic/sysmodule.c.h b/Python/clinic/sysmodule.c.h index 971f88bc2395f3..c37ed666ae8843 100644 --- a/Python/clinic/sysmodule.c.h +++ b/Python/clinic/sysmodule.c.h @@ -228,7 +228,7 @@ sys_intern(PyObject *module, PyObject *arg) PyObject *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("intern", 0, NULL, "str", arg); + _PyArg_BadArgument("intern", 0, "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -925,7 +925,7 @@ sys_call_tracing(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } func = args[0]; if (!PyTuple_Check(args[1])) { - _PyArg_BadArgument("call_tracing", 2, NULL, "tuple", args[1]); + _PyArg_BadArgument("call_tracing", 2, "argument 2", "tuple", args[1]); goto exit; } funcargs = args[1]; @@ -1082,4 +1082,4 @@ sys_getandroidapilevel(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef SYS_GETANDROIDAPILEVEL_METHODDEF #define SYS_GETANDROIDAPILEVEL_METHODDEF #endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */ -/*[clinic end generated code: output=223863edf9d0e4d9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=01592ef076925d6f input=a9049054013a1b77]*/ diff --git a/Python/clinic/traceback.c.h b/Python/clinic/traceback.c.h index 64eea1e6f3dab1..427513cf0ee09e 100644 --- a/Python/clinic/traceback.c.h +++ b/Python/clinic/traceback.c.h @@ -32,7 +32,7 @@ tb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) } tb_next = fastargs[0]; if (!PyObject_TypeCheck(fastargs[1], &PyFrame_Type)) { - _PyArg_BadArgument("TracebackType", 2, "tb_frame", (&PyFrame_Type)->tp_name, fastargs[1]); + _PyArg_BadArgument("TracebackType", 2, "argument 'tb_frame'", (&PyFrame_Type)->tp_name, fastargs[1]); goto exit; } tb_frame = (PyFrameObject *)fastargs[1]; @@ -59,4 +59,4 @@ tb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=e636e37c29947c87 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4574241b9fd9494c input=a9049054013a1b77]*/ diff --git a/Python/getargs.c b/Python/getargs.c index 20c6b6f30a9a59..3e1547754975c1 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -611,31 +611,17 @@ convertitem(PyObject *arg, const char **p_format, va_list *p_va, int flags, /* Format an error message generated by convertsimple(). - argname must be UTF-8 encodeded. + displayname must be UTF-8 encodeded. */ void -_PyArg_BadArgument(const char *fname, int iarg, const char *argname, +_PyArg_BadArgument(const char *fname, int iarg, const char *displayname, const char *expected, PyObject *arg) { - if (iarg) { - if (argname) { - PyErr_Format(PyExc_TypeError, - "%.200s() argument '%.200s' must be %.50s, not %.50s", - fname, argname, expected, - arg == Py_None ? "None" : arg->ob_type->tp_name); - } else { - PyErr_Format(PyExc_TypeError, - "%.200s() argument %d must be %.50s, not %.50s", - fname, iarg, expected, - arg == Py_None ? "None" : arg->ob_type->tp_name); - } - } else { - PyErr_Format(PyExc_TypeError, - "%.200s() argument must be %.50s, not %.50s", - fname, expected, - arg == Py_None ? "None" : arg->ob_type->tp_name); - } + PyErr_Format(PyExc_TypeError, + "%.200s() %.200s must be %.50s, not %.50s", + fname, displayname, expected, + arg == Py_None ? "None" : arg->ob_type->tp_name); } static const char * diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index f523ca0f9dcfa9..cf7b14e1b5a4f5 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -806,7 +806,7 @@ def parser_body(prototype, *fields, declarations=''): {c_basename}({self_type}{self_name}, PyObject *%s) """ % argname) - displayname = parameters[0].displayname() + displayname = parameters[0].get_displayname(0) parsearg = converters[0].parse_arg(argname, 0, displayname) if parsearg is None: parsearg = """ @@ -852,7 +852,7 @@ def parser_body(prototype, *fields, declarations=''): """ % (nargs, min_pos, max_pos), indent=4)] has_optional = False for i, p in enumerate(parameters): - displayname = p.displayname() + displayname = p.get_displayname(i+1) parsearg = p.converter.parse_arg(argname_fmt % i, i + 1, displayname) if parsearg is None: #print('Cannot convert %s %r for %s' % (p.converter.__class__.__name__, p.converter.format_unit, p.converter.name), file=sys.stderr) @@ -929,7 +929,7 @@ def parser_body(prototype, *fields, declarations=''): add_label = None for i, p in enumerate(parameters): - displayname = p.displayname() + displayname = p.get_displayname(i+1) parsearg = p.converter.parse_arg(argname_fmt % i, i + 1, displayname) if parsearg is None: #print('Cannot convert %s %r for %s' % (p.converter.__class__.__name__, p.converter.format_unit, p.converter.name), file=sys.stderr) @@ -2296,11 +2296,13 @@ def copy(self, **overrides): kwargs['converter'] = converter return Parameter(**kwargs) - def displayname(self): + def get_displayname(self, i): + if i == 0: + return '"argument"' if self.is_positional_or_keyword(): - return '"{}"'.format(self.name) + return '''"argument '{}'"'''.format(self.name) else: - return 'NULL' + return '"argument {}"'.format(i) class LandMine: From 3abeae16c59308142d5cb10869316ed2e6867824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Lapeyre?= Date: Tue, 11 Jun 2019 12:51:27 +0200 Subject: [PATCH 13/15] Simplify _PyArg_BadArgument --- Include/modsupport.h | 2 +- Lib/test/clinic.test | 86 ++++----- Modules/_blake2/clinic/blake2b_impl.c.h | 8 +- Modules/_blake2/clinic/blake2s_impl.c.h | 8 +- Modules/_io/clinic/_iomodule.c.h | 12 +- Modules/_io/clinic/bufferedio.c.h | 20 +-- Modules/_io/clinic/bytesio.c.h | 6 +- Modules/_io/clinic/fileio.c.h | 10 +- Modules/_io/clinic/textio.c.h | 8 +- Modules/_io/clinic/winconsoleio.c.h | 10 +- .../_multiprocessing/clinic/posixshmem.c.h | 6 +- Modules/cjkcodecs/clinic/multibytecodec.c.h | 14 +- Modules/clinic/_bz2module.c.h | 6 +- Modules/clinic/_codecsmodule.c.h | 168 +++++++++--------- Modules/clinic/_cryptmodule.c.h | 6 +- Modules/clinic/_curses_panel.c.h | 6 +- Modules/clinic/_cursesmodule.c.h | 14 +- Modules/clinic/_dbmmodule.c.h | 6 +- Modules/clinic/_elementtree.c.h | 12 +- Modules/clinic/_gdbmmodule.c.h | 6 +- Modules/clinic/_hashopenssl.c.h | 24 +-- Modules/clinic/_lzmamodule.c.h | 8 +- Modules/clinic/_pickle.c.h | 14 +- Modules/clinic/_sre.c.h | 8 +- Modules/clinic/_ssl.c.h | 28 +-- Modules/clinic/_struct.c.h | 10 +- Modules/clinic/_tkinter.c.h | 30 ++-- Modules/clinic/_weakref.c.h | 4 +- Modules/clinic/arraymodule.c.h | 10 +- Modules/clinic/audioop.c.h | 60 +++---- Modules/clinic/binascii.c.h | 22 +-- Modules/clinic/grpmodule.c.h | 4 +- Modules/clinic/itertoolsmodule.c.h | 6 +- Modules/clinic/mathmodule.c.h | 6 +- Modules/clinic/posixmodule.c.h | 16 +- Modules/clinic/pwdmodule.c.h | 4 +- Modules/clinic/pyexpat.c.h | 12 +- Modules/clinic/signalmodule.c.h | 4 +- Modules/clinic/spwdmodule.c.h | 4 +- Modules/clinic/symtablemodule.c.h | 4 +- Modules/clinic/unicodedata.c.h | 50 +++--- Modules/clinic/zlibmodule.c.h | 16 +- Objects/clinic/bytearrayobject.c.h | 16 +- Objects/clinic/bytesobject.c.h | 20 +-- Objects/clinic/codeobject.c.h | 20 +-- Objects/clinic/floatobject.c.h | 10 +- Objects/clinic/funcobject.c.h | 6 +- Objects/clinic/longobject.c.h | 8 +- Objects/clinic/moduleobject.c.h | 4 +- Objects/clinic/typeobject.c.h | 4 +- Objects/clinic/unicodeobject.c.h | 16 +- Objects/stringlib/clinic/transmogrify.h.h | 8 +- PC/clinic/_testconsole.c.h | 4 +- PC/clinic/msvcrtmodule.c.h | 14 +- Python/clinic/bltinmodule.c.h | 6 +- Python/clinic/import.c.h | 18 +- Python/clinic/marshal.c.h | 4 +- Python/clinic/sysmodule.c.h | 6 +- Python/clinic/traceback.c.h | 4 +- Python/getargs.c | 2 +- Tools/clinic/clinic.py | 154 ++++++++-------- 61 files changed, 541 insertions(+), 541 deletions(-) diff --git a/Include/modsupport.h b/Include/modsupport.h index 2bae263e4b2e8a..f90ede4831e32b 100644 --- a/Include/modsupport.h +++ b/Include/modsupport.h @@ -66,7 +66,7 @@ PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args); #define _PyArg_NoPositional(funcname, args) \ ((args) == NULL || _PyArg_NoPositional((funcname), (args))) -PyAPI_FUNC(void) _PyArg_BadArgument(const char *, int, const char *, const char *, PyObject *); +PyAPI_FUNC(void) _PyArg_BadArgument(const char *, const char *, const char *, PyObject *); PyAPI_FUNC(int) _PyArg_CheckPositional(const char *, Py_ssize_t, Py_ssize_t, Py_ssize_t); #define _PyArg_CheckPositional(funcname, nargs, min, max) \ diff --git a/Lib/test/clinic.test b/Lib/test/clinic.test index a9e1d7ada19224..8d797971b0124b 100644 --- a/Lib/test/clinic.test +++ b/Lib/test/clinic.test @@ -44,7 +44,7 @@ test_object_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("test_object_converter", 3, NULL, "str", args[2]); + _PyArg_BadArgument("test_object_converter", "argument 3", "str", args[2]); goto exit; } c = args[2]; @@ -58,7 +58,7 @@ exit: static PyObject * test_object_converter_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c, PyUnicode_Object *d) -/*[clinic end generated code: output=2de0f1e8f6ee45a3 input=005e6a8a711a869b]*/ +/*[clinic end generated code: output=a78312d933df9ea1 input=005e6a8a711a869b]*/ /*[clinic input] @@ -180,52 +180,52 @@ test_object_converter_subclass_of(PyObject *module, PyObject *const *args, Py_ss goto exit; } if (!PyLong_Check(args[0])) { - _PyArg_BadArgument("test_object_converter_subclass_of", 1, NULL, "int", args[0]); + _PyArg_BadArgument("test_object_converter_subclass_of", "argument 1", "int", args[0]); goto exit; } a = args[0]; if (!PyTuple_Check(args[1])) { - _PyArg_BadArgument("test_object_converter_subclass_of", 2, NULL, "tuple", args[1]); + _PyArg_BadArgument("test_object_converter_subclass_of", "argument 2", "tuple", args[1]); goto exit; } b = args[1]; if (!PyList_Check(args[2])) { - _PyArg_BadArgument("test_object_converter_subclass_of", 3, NULL, "list", args[2]); + _PyArg_BadArgument("test_object_converter_subclass_of", "argument 3", "list", args[2]); goto exit; } c = args[2]; if (!PySet_Check(args[3])) { - _PyArg_BadArgument("test_object_converter_subclass_of", 4, NULL, "set", args[3]); + _PyArg_BadArgument("test_object_converter_subclass_of", "argument 4", "set", args[3]); goto exit; } d = args[3]; if (!PyFrozenSet_Check(args[4])) { - _PyArg_BadArgument("test_object_converter_subclass_of", 5, NULL, "frozenset", args[4]); + _PyArg_BadArgument("test_object_converter_subclass_of", "argument 5", "frozenset", args[4]); goto exit; } e = args[4]; if (!PyDict_Check(args[5])) { - _PyArg_BadArgument("test_object_converter_subclass_of", 6, NULL, "dict", args[5]); + _PyArg_BadArgument("test_object_converter_subclass_of", "argument 6", "dict", args[5]); goto exit; } f = args[5]; if (!PyUnicode_Check(args[6])) { - _PyArg_BadArgument("test_object_converter_subclass_of", 7, NULL, "str", args[6]); + _PyArg_BadArgument("test_object_converter_subclass_of", "argument 7", "str", args[6]); goto exit; } g = args[6]; if (!PyBytes_Check(args[7])) { - _PyArg_BadArgument("test_object_converter_subclass_of", 8, NULL, "bytes", args[7]); + _PyArg_BadArgument("test_object_converter_subclass_of", "argument 8", "bytes", args[7]); goto exit; } h = args[7]; if (!PyByteArray_Check(args[8])) { - _PyArg_BadArgument("test_object_converter_subclass_of", 9, NULL, "bytearray", args[8]); + _PyArg_BadArgument("test_object_converter_subclass_of", "argument 9", "bytearray", args[8]); goto exit; } i = args[8]; if (!PyObject_TypeCheck(args[9], &MyType)) { - _PyArg_BadArgument("test_object_converter_subclass_of", 10, NULL, (&MyType)->tp_name, args[9]); + _PyArg_BadArgument("test_object_converter_subclass_of", "argument 10", (&MyType)->tp_name, args[9]); goto exit; } j = args[9]; @@ -240,7 +240,7 @@ test_object_converter_subclass_of_impl(PyObject *module, PyObject *a, PyObject *b, PyObject *c, PyObject *d, PyObject *e, PyObject *f, PyObject *g, PyObject *h, PyObject *i, PyObject *j) -/*[clinic end generated code: output=823cd4fbe76c3298 input=31b06b772d5f983e]*/ +/*[clinic end generated code: output=dcf7772bf0c876dd input=31b06b772d5f983e]*/ /*[clinic input] @@ -269,7 +269,7 @@ test_PyBytesObject_converter(PyObject *module, PyObject *arg) PyBytesObject *a; if (!PyBytes_Check(arg)) { - _PyArg_BadArgument("test_PyBytesObject_converter", 0, NULL, "bytes", arg); + _PyArg_BadArgument("test_PyBytesObject_converter", "argument", "bytes", arg); goto exit; } a = (PyBytesObject *)arg; @@ -281,7 +281,7 @@ exit: static PyObject * test_PyBytesObject_converter_impl(PyObject *module, PyBytesObject *a) -/*[clinic end generated code: output=b96ac2ef4d3b6027 input=12b10c7cb5750400]*/ +/*[clinic end generated code: output=7539d628e6fceace input=12b10c7cb5750400]*/ /*[clinic input] @@ -310,7 +310,7 @@ test_PyByteArrayObject_converter(PyObject *module, PyObject *arg) PyByteArrayObject *a; if (!PyByteArray_Check(arg)) { - _PyArg_BadArgument("test_PyByteArrayObject_converter", 0, NULL, "bytearray", arg); + _PyArg_BadArgument("test_PyByteArrayObject_converter", "argument", "bytearray", arg); goto exit; } a = (PyByteArrayObject *)arg; @@ -322,7 +322,7 @@ exit: static PyObject * test_PyByteArrayObject_converter_impl(PyObject *module, PyByteArrayObject *a) -/*[clinic end generated code: output=61699c6a617e80f8 input=5a657da535d194ae]*/ +/*[clinic end generated code: output=1245af9f5b3e355e input=5a657da535d194ae]*/ /*[clinic input] @@ -351,7 +351,7 @@ test_unicode_converter(PyObject *module, PyObject *arg) PyObject *a; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("test_unicode_converter", 0, NULL, "str", arg); + _PyArg_BadArgument("test_unicode_converter", "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -366,7 +366,7 @@ exit: static PyObject * test_unicode_converter_impl(PyObject *module, PyObject *a) -/*[clinic end generated code: output=da4a52a3672efb43 input=aa33612df92aa9c5]*/ +/*[clinic end generated code: output=18f1e3880c862611 input=aa33612df92aa9c5]*/ /*[clinic input] @@ -507,7 +507,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) a = PyByteArray_AS_STRING(args[0])[0]; } else { - _PyArg_BadArgument("test_char_converter", 1, NULL, "a byte string of length 1", args[0]); + _PyArg_BadArgument("test_char_converter", "argument 1", "a byte string of length 1", args[0]); goto exit; } if (nargs < 2) { @@ -520,7 +520,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) b = PyByteArray_AS_STRING(args[1])[0]; } else { - _PyArg_BadArgument("test_char_converter", 2, NULL, "a byte string of length 1", args[1]); + _PyArg_BadArgument("test_char_converter", "argument 2", "a byte string of length 1", args[1]); goto exit; } if (nargs < 3) { @@ -533,7 +533,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) c = PyByteArray_AS_STRING(args[2])[0]; } else { - _PyArg_BadArgument("test_char_converter", 3, NULL, "a byte string of length 1", args[2]); + _PyArg_BadArgument("test_char_converter", "argument 3", "a byte string of length 1", args[2]); goto exit; } if (nargs < 4) { @@ -546,7 +546,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) d = PyByteArray_AS_STRING(args[3])[0]; } else { - _PyArg_BadArgument("test_char_converter", 4, NULL, "a byte string of length 1", args[3]); + _PyArg_BadArgument("test_char_converter", "argument 4", "a byte string of length 1", args[3]); goto exit; } if (nargs < 5) { @@ -559,7 +559,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) e = PyByteArray_AS_STRING(args[4])[0]; } else { - _PyArg_BadArgument("test_char_converter", 5, NULL, "a byte string of length 1", args[4]); + _PyArg_BadArgument("test_char_converter", "argument 5", "a byte string of length 1", args[4]); goto exit; } if (nargs < 6) { @@ -572,7 +572,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) f = PyByteArray_AS_STRING(args[5])[0]; } else { - _PyArg_BadArgument("test_char_converter", 6, NULL, "a byte string of length 1", args[5]); + _PyArg_BadArgument("test_char_converter", "argument 6", "a byte string of length 1", args[5]); goto exit; } if (nargs < 7) { @@ -585,7 +585,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) g = PyByteArray_AS_STRING(args[6])[0]; } else { - _PyArg_BadArgument("test_char_converter", 7, NULL, "a byte string of length 1", args[6]); + _PyArg_BadArgument("test_char_converter", "argument 7", "a byte string of length 1", args[6]); goto exit; } if (nargs < 8) { @@ -598,7 +598,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) h = PyByteArray_AS_STRING(args[7])[0]; } else { - _PyArg_BadArgument("test_char_converter", 8, NULL, "a byte string of length 1", args[7]); + _PyArg_BadArgument("test_char_converter", "argument 8", "a byte string of length 1", args[7]); goto exit; } if (nargs < 9) { @@ -611,7 +611,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) i = PyByteArray_AS_STRING(args[8])[0]; } else { - _PyArg_BadArgument("test_char_converter", 9, NULL, "a byte string of length 1", args[8]); + _PyArg_BadArgument("test_char_converter", "argument 9", "a byte string of length 1", args[8]); goto exit; } if (nargs < 10) { @@ -624,7 +624,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) j = PyByteArray_AS_STRING(args[9])[0]; } else { - _PyArg_BadArgument("test_char_converter", 10, NULL, "a byte string of length 1", args[9]); + _PyArg_BadArgument("test_char_converter", "argument 10", "a byte string of length 1", args[9]); goto exit; } if (nargs < 11) { @@ -637,7 +637,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) k = PyByteArray_AS_STRING(args[10])[0]; } else { - _PyArg_BadArgument("test_char_converter", 11, NULL, "a byte string of length 1", args[10]); + _PyArg_BadArgument("test_char_converter", "argument 11", "a byte string of length 1", args[10]); goto exit; } if (nargs < 12) { @@ -650,7 +650,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) l = PyByteArray_AS_STRING(args[11])[0]; } else { - _PyArg_BadArgument("test_char_converter", 12, NULL, "a byte string of length 1", args[11]); + _PyArg_BadArgument("test_char_converter", "argument 12", "a byte string of length 1", args[11]); goto exit; } if (nargs < 13) { @@ -663,7 +663,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) m = PyByteArray_AS_STRING(args[12])[0]; } else { - _PyArg_BadArgument("test_char_converter", 13, NULL, "a byte string of length 1", args[12]); + _PyArg_BadArgument("test_char_converter", "argument 13", "a byte string of length 1", args[12]); goto exit; } if (nargs < 14) { @@ -676,7 +676,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) n = PyByteArray_AS_STRING(args[13])[0]; } else { - _PyArg_BadArgument("test_char_converter", 14, NULL, "a byte string of length 1", args[13]); + _PyArg_BadArgument("test_char_converter", "argument 14", "a byte string of length 1", args[13]); goto exit; } skip_optional: @@ -690,7 +690,7 @@ static PyObject * test_char_converter_impl(PyObject *module, char a, char b, char c, char d, char e, char f, char g, char h, char i, char j, char k, char l, char m, char n) -/*[clinic end generated code: output=911fd6b0a8707d54 input=e42330417a44feac]*/ +/*[clinic end generated code: output=9d3aaf5d6857ec9e input=e42330417a44feac]*/ /*[clinic input] @@ -1009,14 +1009,14 @@ test_int_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("test_int_converter", 3, NULL, "a unicode character", args[2]); + _PyArg_BadArgument("test_int_converter", "argument 3", "a unicode character", args[2]); goto exit; } if (PyUnicode_READY(args[2])) { goto exit; } if (PyUnicode_GET_LENGTH(args[2]) != 1) { - _PyArg_BadArgument("test_int_converter", 3, NULL, "a unicode character", args[2]); + _PyArg_BadArgument("test_int_converter", "argument 3", "a unicode character", args[2]); goto exit; } c = PyUnicode_READ_CHAR(args[2], 0); @@ -1041,7 +1041,7 @@ exit: static PyObject * test_int_converter_impl(PyObject *module, int a, int b, int c, myenum d) -/*[clinic end generated code: output=dea1562ef1ad1efb input=d20541fc1ca0553e]*/ +/*[clinic end generated code: output=10a2e48a34af5d7a input=d20541fc1ca0553e]*/ /*[clinic input] @@ -1215,7 +1215,7 @@ test_unsigned_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t goto skip_optional; } if (!PyLong_Check(args[2])) { - _PyArg_BadArgument("test_unsigned_long_converter", 3, NULL, "int", args[2]); + _PyArg_BadArgument("test_unsigned_long_converter", "argument 3", "int", args[2]); goto exit; } c = PyLong_AsUnsignedLongMask(args[2]); @@ -1229,7 +1229,7 @@ exit: static PyObject * test_unsigned_long_converter_impl(PyObject *module, unsigned long a, unsigned long b, unsigned long c) -/*[clinic end generated code: output=d70fa21188eb8a19 input=f450d94cae1ef73b]*/ +/*[clinic end generated code: output=87c6b29fa217026e input=f450d94cae1ef73b]*/ /*[clinic input] @@ -1335,7 +1335,7 @@ test_unsigned_long_long_converter(PyObject *module, PyObject *const *args, Py_ss goto skip_optional; } if (!PyLong_Check(args[2])) { - _PyArg_BadArgument("test_unsigned_long_long_converter", 3, NULL, "int", args[2]); + _PyArg_BadArgument("test_unsigned_long_long_converter", "argument 3", "int", args[2]); goto exit; } c = PyLong_AsUnsignedLongLongMask(args[2]); @@ -1351,7 +1351,7 @@ test_unsigned_long_long_converter_impl(PyObject *module, unsigned long long a, unsigned long long b, unsigned long long c) -/*[clinic end generated code: output=7949607b82837b4b input=a15115dc41866ff4]*/ +/*[clinic end generated code: output=aad2c7b43db2f190 input=a15115dc41866ff4]*/ /*[clinic input] @@ -3234,7 +3234,7 @@ test_keyword_only_parameter(PyObject *module, PyObject *const *args, Py_ssize_t goto skip_optional_kwonly; } if (!PyBytes_Check(args[0])) { - _PyArg_BadArgument("test_keyword_only_parameter", 1, "co_lnotab", "bytes", args[0]); + _PyArg_BadArgument("test_keyword_only_parameter", "argument 'co_lnotab'", "bytes", args[0]); goto exit; } co_lnotab = (PyBytesObject *)args[0]; @@ -3247,4 +3247,4 @@ exit: static PyObject * test_keyword_only_parameter_impl(PyObject *module, PyBytesObject *co_lnotab) -/*[clinic end generated code: output=b44208ba80c05287 input=303df5046c7e37a3]*/ +/*[clinic end generated code: output=f25914b402039493 input=303df5046c7e37a3]*/ diff --git a/Modules/_blake2/clinic/blake2b_impl.c.h b/Modules/_blake2/clinic/blake2b_impl.c.h index 12920ef3d0403f..cd329c07c99981 100644 --- a/Modules/_blake2/clinic/blake2b_impl.c.h +++ b/Modules/_blake2/clinic/blake2b_impl.c.h @@ -72,7 +72,7 @@ py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&key, 'C')) { - _PyArg_BadArgument("blake2b", 3, "argument 'key'", "contiguous buffer", fastargs[2]); + _PyArg_BadArgument("blake2b", "argument 'key'", "contiguous buffer", fastargs[2]); goto exit; } if (!--noptargs) { @@ -84,7 +84,7 @@ py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&salt, 'C')) { - _PyArg_BadArgument("blake2b", 4, "argument 'salt'", "contiguous buffer", fastargs[3]); + _PyArg_BadArgument("blake2b", "argument 'salt'", "contiguous buffer", fastargs[3]); goto exit; } if (!--noptargs) { @@ -96,7 +96,7 @@ py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&person, 'C')) { - _PyArg_BadArgument("blake2b", 5, "argument 'person'", "contiguous buffer", fastargs[4]); + _PyArg_BadArgument("blake2b", "argument 'person'", "contiguous buffer", fastargs[4]); goto exit; } if (!--noptargs) { @@ -261,4 +261,4 @@ _blake2_blake2b_hexdigest(BLAKE2bObject *self, PyObject *Py_UNUSED(ignored)) { return _blake2_blake2b_hexdigest_impl(self); } -/*[clinic end generated code: output=6186e23d1ccf890d input=a9049054013a1b77]*/ +/*[clinic end generated code: output=cbb625d7f60c288c input=a9049054013a1b77]*/ diff --git a/Modules/_blake2/clinic/blake2s_impl.c.h b/Modules/_blake2/clinic/blake2s_impl.c.h index 4e11df4cb0c99d..560bd68160b016 100644 --- a/Modules/_blake2/clinic/blake2s_impl.c.h +++ b/Modules/_blake2/clinic/blake2s_impl.c.h @@ -72,7 +72,7 @@ py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&key, 'C')) { - _PyArg_BadArgument("blake2s", 3, "argument 'key'", "contiguous buffer", fastargs[2]); + _PyArg_BadArgument("blake2s", "argument 'key'", "contiguous buffer", fastargs[2]); goto exit; } if (!--noptargs) { @@ -84,7 +84,7 @@ py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&salt, 'C')) { - _PyArg_BadArgument("blake2s", 4, "argument 'salt'", "contiguous buffer", fastargs[3]); + _PyArg_BadArgument("blake2s", "argument 'salt'", "contiguous buffer", fastargs[3]); goto exit; } if (!--noptargs) { @@ -96,7 +96,7 @@ py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyBuffer_IsContiguous(&person, 'C')) { - _PyArg_BadArgument("blake2s", 5, "argument 'person'", "contiguous buffer", fastargs[4]); + _PyArg_BadArgument("blake2s", "argument 'person'", "contiguous buffer", fastargs[4]); goto exit; } if (!--noptargs) { @@ -261,4 +261,4 @@ _blake2_blake2s_hexdigest(BLAKE2sObject *self, PyObject *Py_UNUSED(ignored)) { return _blake2_blake2s_hexdigest_impl(self); } -/*[clinic end generated code: output=7de1fdb386eb0858 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=39af5a74c8805b36 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/_iomodule.c.h b/Modules/_io/clinic/_iomodule.c.h index a02434d2010ec4..1a9651d340813f 100644 --- a/Modules/_io/clinic/_iomodule.c.h +++ b/Modules/_io/clinic/_iomodule.c.h @@ -161,7 +161,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw } if (args[1]) { if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("open", 2, "argument 'mode'", "str", args[1]); + _PyArg_BadArgument("open", "argument 'mode'", "str", args[1]); goto exit; } Py_ssize_t mode_length; @@ -207,7 +207,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw } } else { - _PyArg_BadArgument("open", 4, "argument 'encoding'", "str or None", args[3]); + _PyArg_BadArgument("open", "argument 'encoding'", "str or None", args[3]); goto exit; } if (!--noptargs) { @@ -230,7 +230,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw } } else { - _PyArg_BadArgument("open", 5, "argument 'errors'", "str or None", args[4]); + _PyArg_BadArgument("open", "argument 'errors'", "str or None", args[4]); goto exit; } if (!--noptargs) { @@ -253,7 +253,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw } } else { - _PyArg_BadArgument("open", 6, "argument 'newline'", "str or None", args[5]); + _PyArg_BadArgument("open", "argument 'newline'", "str or None", args[5]); goto exit; } if (!--noptargs) { @@ -311,7 +311,7 @@ _io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("open_code", 1, "argument 'path'", "str", args[0]); + _PyArg_BadArgument("open_code", "argument 'path'", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -323,4 +323,4 @@ _io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=16642398793371ec input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3df6bc6d91697545 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bufferedio.c.h b/Modules/_io/clinic/bufferedio.c.h index 564d77e316dc9e..72841fcb6779c7 100644 --- a/Modules/_io/clinic/bufferedio.c.h +++ b/Modules/_io/clinic/bufferedio.c.h @@ -21,11 +21,11 @@ _io__BufferedIOBase_readinto(PyObject *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", 0, "argument", "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg); goto exit; } return_value = _io__BufferedIOBase_readinto_impl(self, &buffer); @@ -58,11 +58,11 @@ _io__BufferedIOBase_readinto1(PyObject *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto1", 0, "argument", "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto1", "argument", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto1", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("readinto1", "argument", "contiguous buffer", arg); goto exit; } return_value = _io__BufferedIOBase_readinto1_impl(self, &buffer); @@ -243,11 +243,11 @@ _io__Buffered_readinto(buffered *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", 0, "argument", "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg); goto exit; } return_value = _io__Buffered_readinto_impl(self, &buffer); @@ -280,11 +280,11 @@ _io__Buffered_readinto1(buffered *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto1", 0, "argument", "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto1", "argument", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto1", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("readinto1", "argument", "contiguous buffer", arg); goto exit; } return_value = _io__Buffered_readinto1_impl(self, &buffer); @@ -538,7 +538,7 @@ _io_BufferedWriter_write(buffered *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("write", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("write", "argument", "contiguous buffer", arg); goto exit; } return_value = _io_BufferedWriter_write_impl(self, &buffer); @@ -672,4 +672,4 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=c5bdcc46d36124ff input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7246104f6c7d3167 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/bytesio.c.h b/Modules/_io/clinic/bytesio.c.h index fbdfb3b723aebc..83cd490dc59804 100644 --- a/Modules/_io/clinic/bytesio.c.h +++ b/Modules/_io/clinic/bytesio.c.h @@ -319,11 +319,11 @@ _io_BytesIO_readinto(bytesio *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", 0, "argument", "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg); goto exit; } return_value = _io_BytesIO_readinto_impl(self, &buffer); @@ -515,4 +515,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=e7d7e9041e6eb116 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=4ec2506def9c8eb9 input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/fileio.c.h b/Modules/_io/clinic/fileio.c.h index ec60c2cda008f5..64addde57f3e47 100644 --- a/Modules/_io/clinic/fileio.c.h +++ b/Modules/_io/clinic/fileio.c.h @@ -70,7 +70,7 @@ _io_FileIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) } if (fastargs[1]) { if (!PyUnicode_Check(fastargs[1])) { - _PyArg_BadArgument("FileIO", 2, "argument 'mode'", "str", fastargs[1]); + _PyArg_BadArgument("FileIO", "argument 'mode'", "str", fastargs[1]); goto exit; } Py_ssize_t mode_length; @@ -200,11 +200,11 @@ _io_FileIO_readinto(fileio *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", 0, "argument", "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg); goto exit; } return_value = _io_FileIO_readinto_impl(self, &buffer); @@ -303,7 +303,7 @@ _io_FileIO_write(fileio *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&b, 'C')) { - _PyArg_BadArgument("write", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("write", "argument", "contiguous buffer", arg); goto exit; } return_value = _io_FileIO_write_impl(self, &b); @@ -447,4 +447,4 @@ _io_FileIO_isatty(fileio *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO_FILEIO_TRUNCATE_METHODDEF #define _IO_FILEIO_TRUNCATE_METHODDEF #endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */ -/*[clinic end generated code: output=ac058b01a373e2d7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a7e9cca3613660fb input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/textio.c.h b/Modules/_io/clinic/textio.c.h index 1f6d83615f1fd5..b8b507543ea81c 100644 --- a/Modules/_io/clinic/textio.c.h +++ b/Modules/_io/clinic/textio.c.h @@ -229,7 +229,7 @@ _io_TextIOWrapper___init__(PyObject *self, PyObject *args, PyObject *kwargs) } } else { - _PyArg_BadArgument("TextIOWrapper", 2, "argument 'encoding'", "str or None", fastargs[1]); + _PyArg_BadArgument("TextIOWrapper", "argument 'encoding'", "str or None", fastargs[1]); goto exit; } if (!--noptargs) { @@ -258,7 +258,7 @@ _io_TextIOWrapper___init__(PyObject *self, PyObject *args, PyObject *kwargs) } } else { - _PyArg_BadArgument("TextIOWrapper", 4, "argument 'newline'", "str or None", fastargs[3]); + _PyArg_BadArgument("TextIOWrapper", "argument 'newline'", "str or None", fastargs[3]); goto exit; } if (!--noptargs) { @@ -401,7 +401,7 @@ _io_TextIOWrapper_write(textio *self, PyObject *arg) PyObject *text; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("write", 0, "argument", "str", arg); + _PyArg_BadArgument("write", "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -701,4 +701,4 @@ _io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored)) { return _io_TextIOWrapper_close_impl(self); } -/*[clinic end generated code: output=fa25e938e78ed2c7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b1bae4f4cdf6019e input=a9049054013a1b77]*/ diff --git a/Modules/_io/clinic/winconsoleio.c.h b/Modules/_io/clinic/winconsoleio.c.h index 9a292e84e6b174..3e501a58537165 100644 --- a/Modules/_io/clinic/winconsoleio.c.h +++ b/Modules/_io/clinic/winconsoleio.c.h @@ -69,7 +69,7 @@ _io__WindowsConsoleIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) } if (fastargs[1]) { if (!PyUnicode_Check(fastargs[1])) { - _PyArg_BadArgument("_WindowsConsoleIO", 2, "argument 'mode'", "str", fastargs[1]); + _PyArg_BadArgument("_WindowsConsoleIO", "argument 'mode'", "str", fastargs[1]); goto exit; } Py_ssize_t mode_length; @@ -200,11 +200,11 @@ _io__WindowsConsoleIO_readinto(winconsoleio *self, PyObject *arg) if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { PyErr_Clear(); - _PyArg_BadArgument("readinto", 0, "argument", "read-write bytes-like object", arg); + _PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg); goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("readinto", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg); goto exit; } return_value = _io__WindowsConsoleIO_readinto_impl(self, &buffer); @@ -313,7 +313,7 @@ _io__WindowsConsoleIO_write(winconsoleio *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&b, 'C')) { - _PyArg_BadArgument("write", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("write", "argument", "contiguous buffer", arg); goto exit; } return_value = _io__WindowsConsoleIO_write_impl(self, &b); @@ -386,4 +386,4 @@ _io__WindowsConsoleIO_isatty(winconsoleio *self, PyObject *Py_UNUSED(ignored)) #ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF #endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */ -/*[clinic end generated code: output=4d3874d820766005 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f5b8860a658a001a input=a9049054013a1b77]*/ diff --git a/Modules/_multiprocessing/clinic/posixshmem.c.h b/Modules/_multiprocessing/clinic/posixshmem.c.h index 301c0a511182d4..a99f0d2aae1dcb 100644 --- a/Modules/_multiprocessing/clinic/posixshmem.c.h +++ b/Modules/_multiprocessing/clinic/posixshmem.c.h @@ -35,7 +35,7 @@ _posixshmem_shm_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("shm_open", 1, "argument 'path'", "str", args[0]); + _PyArg_BadArgument("shm_open", "argument 'path'", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -108,7 +108,7 @@ _posixshmem_shm_unlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("shm_unlink", 1, "argument 'path'", "str", args[0]); + _PyArg_BadArgument("shm_unlink", "argument 'path'", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -130,4 +130,4 @@ _posixshmem_shm_unlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs #ifndef _POSIXSHMEM_SHM_UNLINK_METHODDEF #define _POSIXSHMEM_SHM_UNLINK_METHODDEF #endif /* !defined(_POSIXSHMEM_SHM_UNLINK_METHODDEF) */ -/*[clinic end generated code: output=6f0f6a641a6f1a1c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9132861c61d8c2d8 input=a9049054013a1b77]*/ diff --git a/Modules/cjkcodecs/clinic/multibytecodec.c.h b/Modules/cjkcodecs/clinic/multibytecodec.c.h index f4704aa827ca0b..5ddbbe221b98b9 100644 --- a/Modules/cjkcodecs/clinic/multibytecodec.c.h +++ b/Modules/cjkcodecs/clinic/multibytecodec.c.h @@ -55,7 +55,7 @@ _multibytecodec_MultibyteCodec_encode(MultibyteCodecObject *self, PyObject *cons } } else { - _PyArg_BadArgument("encode", 2, "argument 'errors'", "str or None", args[1]); + _PyArg_BadArgument("encode", "argument 'errors'", "str or None", args[1]); goto exit; } skip_optional_pos: @@ -103,7 +103,7 @@ _multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject *cons goto exit; } if (!PyBuffer_IsContiguous(&input, 'C')) { - _PyArg_BadArgument("decode", 1, "argument 'input'", "contiguous buffer", args[0]); + _PyArg_BadArgument("decode", "argument 'input'", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -124,7 +124,7 @@ _multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject *cons } } else { - _PyArg_BadArgument("decode", 2, "argument 'errors'", "str or None", args[1]); + _PyArg_BadArgument("decode", "argument 'errors'", "str or None", args[1]); goto exit; } skip_optional_pos: @@ -223,7 +223,7 @@ _multibytecodec_MultibyteIncrementalEncoder_setstate(MultibyteIncrementalEncoder PyLongObject *statelong; if (!PyLong_Check(arg)) { - _PyArg_BadArgument("setstate", 0, "argument", "int", arg); + _PyArg_BadArgument("setstate", "argument", "int", arg); goto exit; } statelong = (PyLongObject *)arg; @@ -282,7 +282,7 @@ _multibytecodec_MultibyteIncrementalDecoder_decode(MultibyteIncrementalDecoderOb goto exit; } if (!PyBuffer_IsContiguous(&input, 'C')) { - _PyArg_BadArgument("decode", 1, "argument 'input'", "contiguous buffer", args[0]); + _PyArg_BadArgument("decode", "argument 'input'", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -345,7 +345,7 @@ _multibytecodec_MultibyteIncrementalDecoder_setstate(MultibyteIncrementalDecoder PyObject *state; if (!PyTuple_Check(arg)) { - _PyArg_BadArgument("setstate", 0, "argument", "tuple", arg); + _PyArg_BadArgument("setstate", "argument", "tuple", arg); goto exit; } state = arg; @@ -525,4 +525,4 @@ PyDoc_STRVAR(_multibytecodec___create_codec__doc__, #define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \ {"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__}, -/*[clinic end generated code: output=01ee90b93764f1ac input=a9049054013a1b77]*/ +/*[clinic end generated code: output=5ce6fd4ca1f95620 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_bz2module.c.h b/Modules/clinic/_bz2module.c.h index 6bbc8d9d2d6cff..ac826bd9b5986f 100644 --- a/Modules/clinic/_bz2module.c.h +++ b/Modules/clinic/_bz2module.c.h @@ -29,7 +29,7 @@ _bz2_BZ2Compressor_compress(BZ2Compressor *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("compress", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("compress", "argument", "contiguous buffer", arg); goto exit; } return_value = _bz2_BZ2Compressor_compress_impl(self, &data); @@ -156,7 +156,7 @@ _bz2_BZ2Decompressor_decompress(BZ2Decompressor *self, PyObject *const *args, Py goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("decompress", 1, "argument 'data'", "contiguous buffer", args[0]); + _PyArg_BadArgument("decompress", "argument 'data'", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -220,4 +220,4 @@ _bz2_BZ2Decompressor___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=fbf0d1d73fdfb859 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ec3d1b3652c98823 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_codecsmodule.c.h b/Modules/clinic/_codecsmodule.c.h index c0f8c4fbee00e1..be1d2f70cf1b5e 100644 --- a/Modules/clinic/_codecsmodule.c.h +++ b/Modules/clinic/_codecsmodule.c.h @@ -34,7 +34,7 @@ _codecs_lookup(PyObject *module, PyObject *arg) const char *encoding; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("lookup", 0, "argument", "str", arg); + _PyArg_BadArgument("lookup", "argument", "str", arg); goto exit; } Py_ssize_t encoding_length; @@ -93,7 +93,7 @@ _codecs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[1]) { if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("encode", 2, "argument 'encoding'", "str", args[1]); + _PyArg_BadArgument("encode", "argument 'encoding'", "str", args[1]); goto exit; } Py_ssize_t encoding_length; @@ -110,7 +110,7 @@ _codecs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje } } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("encode", 3, "argument 'errors'", "str", args[2]); + _PyArg_BadArgument("encode", "argument 'errors'", "str", args[2]); goto exit; } Py_ssize_t errors_length; @@ -170,7 +170,7 @@ _codecs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[1]) { if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("decode", 2, "argument 'encoding'", "str", args[1]); + _PyArg_BadArgument("decode", "argument 'encoding'", "str", args[1]); goto exit; } Py_ssize_t encoding_length; @@ -187,7 +187,7 @@ _codecs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje } } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("decode", 3, "argument 'errors'", "str", args[2]); + _PyArg_BadArgument("decode", "argument 'errors'", "str", args[2]); goto exit; } Py_ssize_t errors_length; @@ -225,7 +225,7 @@ _codecs__forget_codec(PyObject *module, PyObject *arg) const char *encoding; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("_forget_codec", 0, "argument", "str", arg); + _PyArg_BadArgument("_forget_codec", "argument", "str", arg); goto exit; } Py_ssize_t encoding_length; @@ -278,7 +278,7 @@ _codecs_escape_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("escape_decode", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("escape_decode", "argument 1", "contiguous buffer", args[0]); goto exit; } } @@ -300,7 +300,7 @@ _codecs_escape_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("escape_decode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("escape_decode", "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -338,7 +338,7 @@ _codecs_escape_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBytes_Check(args[0])) { - _PyArg_BadArgument("escape_encode", 1, "argument 1", "bytes", args[0]); + _PyArg_BadArgument("escape_encode", "argument 1", "bytes", args[0]); goto exit; } data = args[0]; @@ -360,7 +360,7 @@ _codecs_escape_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("escape_encode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("escape_encode", "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -397,7 +397,7 @@ _codecs_utf_7_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_7_decode", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_7_decode", "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -418,7 +418,7 @@ _codecs_utf_7_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_7_decode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("utf_7_decode", "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -472,7 +472,7 @@ _codecs_utf_8_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_8_decode", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_8_decode", "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -493,7 +493,7 @@ _codecs_utf_8_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_8_decode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("utf_8_decode", "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -547,7 +547,7 @@ _codecs_utf_16_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_16_decode", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_16_decode", "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -568,7 +568,7 @@ _codecs_utf_16_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_16_decode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("utf_16_decode", "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -622,7 +622,7 @@ _codecs_utf_16_le_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_16_le_decode", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_16_le_decode", "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -643,7 +643,7 @@ _codecs_utf_16_le_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_le_decode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("utf_16_le_decode", "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -697,7 +697,7 @@ _codecs_utf_16_be_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_16_be_decode", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_16_be_decode", "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -718,7 +718,7 @@ _codecs_utf_16_be_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_be_decode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("utf_16_be_decode", "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -774,7 +774,7 @@ _codecs_utf_16_ex_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_16_ex_decode", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_16_ex_decode", "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -795,7 +795,7 @@ _codecs_utf_16_ex_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_ex_decode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("utf_16_ex_decode", "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -861,7 +861,7 @@ _codecs_utf_32_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_32_decode", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_32_decode", "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -882,7 +882,7 @@ _codecs_utf_32_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_32_decode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("utf_32_decode", "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -936,7 +936,7 @@ _codecs_utf_32_le_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_32_le_decode", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_32_le_decode", "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -957,7 +957,7 @@ _codecs_utf_32_le_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_le_decode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("utf_32_le_decode", "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1011,7 +1011,7 @@ _codecs_utf_32_be_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_32_be_decode", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_32_be_decode", "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1032,7 +1032,7 @@ _codecs_utf_32_be_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_be_decode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("utf_32_be_decode", "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1088,7 +1088,7 @@ _codecs_utf_32_ex_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("utf_32_ex_decode", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("utf_32_ex_decode", "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1109,7 +1109,7 @@ _codecs_utf_32_ex_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_ex_decode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("utf_32_ex_decode", "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1183,7 +1183,7 @@ _codecs_unicode_escape_decode(PyObject *module, PyObject *const *args, Py_ssize_ goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("unicode_escape_decode", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("unicode_escape_decode", "argument 1", "contiguous buffer", args[0]); goto exit; } } @@ -1205,7 +1205,7 @@ _codecs_unicode_escape_decode(PyObject *module, PyObject *const *args, Py_ssize_ } } else { - _PyArg_BadArgument("unicode_escape_decode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("unicode_escape_decode", "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -1255,7 +1255,7 @@ _codecs_raw_unicode_escape_decode(PyObject *module, PyObject *const *args, Py_ss goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("raw_unicode_escape_decode", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("raw_unicode_escape_decode", "argument 1", "contiguous buffer", args[0]); goto exit; } } @@ -1277,7 +1277,7 @@ _codecs_raw_unicode_escape_decode(PyObject *module, PyObject *const *args, Py_ss } } else { - _PyArg_BadArgument("raw_unicode_escape_decode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("raw_unicode_escape_decode", "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -1318,7 +1318,7 @@ _codecs_latin_1_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("latin_1_decode", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("latin_1_decode", "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1339,7 +1339,7 @@ _codecs_latin_1_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs } } else { - _PyArg_BadArgument("latin_1_decode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("latin_1_decode", "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -1380,7 +1380,7 @@ _codecs_ascii_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("ascii_decode", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("ascii_decode", "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1401,7 +1401,7 @@ _codecs_ascii_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("ascii_decode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("ascii_decode", "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -1443,7 +1443,7 @@ _codecs_charmap_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("charmap_decode", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("charmap_decode", "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1464,7 +1464,7 @@ _codecs_charmap_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs } } else { - _PyArg_BadArgument("charmap_decode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("charmap_decode", "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1512,7 +1512,7 @@ _codecs_mbcs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("mbcs_decode", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("mbcs_decode", "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1533,7 +1533,7 @@ _codecs_mbcs_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("mbcs_decode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("mbcs_decode", "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1591,7 +1591,7 @@ _codecs_oem_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("oem_decode", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("oem_decode", "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -1612,7 +1612,7 @@ _codecs_oem_decode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("oem_decode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("oem_decode", "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -1680,7 +1680,7 @@ _codecs_code_page_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("code_page_decode", 2, "argument 2", "contiguous buffer", args[1]); + _PyArg_BadArgument("code_page_decode", "argument 2", "contiguous buffer", args[1]); goto exit; } if (nargs < 3) { @@ -1701,7 +1701,7 @@ _codecs_code_page_decode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("code_page_decode", 3, "argument 3", "str or None", args[2]); + _PyArg_BadArgument("code_page_decode", "argument 3", "str or None", args[2]); goto exit; } if (nargs < 4) { @@ -1765,7 +1765,7 @@ _codecs_readbuffer_encode(PyObject *module, PyObject *const *args, Py_ssize_t na goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("readbuffer_encode", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("readbuffer_encode", "argument 1", "contiguous buffer", args[0]); goto exit; } } @@ -1787,7 +1787,7 @@ _codecs_readbuffer_encode(PyObject *module, PyObject *const *args, Py_ssize_t na } } else { - _PyArg_BadArgument("readbuffer_encode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("readbuffer_encode", "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -1825,7 +1825,7 @@ _codecs_utf_7_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_7_encode", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("utf_7_encode", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -1850,7 +1850,7 @@ _codecs_utf_7_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_7_encode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("utf_7_encode", "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -1883,7 +1883,7 @@ _codecs_utf_8_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_8_encode", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("utf_8_encode", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -1908,7 +1908,7 @@ _codecs_utf_8_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_8_encode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("utf_8_encode", "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -1942,7 +1942,7 @@ _codecs_utf_16_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_16_encode", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("utf_16_encode", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -1967,7 +1967,7 @@ _codecs_utf_16_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_16_encode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("utf_16_encode", "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -2012,7 +2012,7 @@ _codecs_utf_16_le_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_16_le_encode", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("utf_16_le_encode", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2037,7 +2037,7 @@ _codecs_utf_16_le_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_le_encode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("utf_16_le_encode", "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2070,7 +2070,7 @@ _codecs_utf_16_be_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_16_be_encode", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("utf_16_be_encode", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2095,7 +2095,7 @@ _codecs_utf_16_be_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_16_be_encode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("utf_16_be_encode", "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2129,7 +2129,7 @@ _codecs_utf_32_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_32_encode", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("utf_32_encode", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2154,7 +2154,7 @@ _codecs_utf_32_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("utf_32_encode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("utf_32_encode", "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -2199,7 +2199,7 @@ _codecs_utf_32_le_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_32_le_encode", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("utf_32_le_encode", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2224,7 +2224,7 @@ _codecs_utf_32_le_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_le_encode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("utf_32_le_encode", "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2257,7 +2257,7 @@ _codecs_utf_32_be_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("utf_32_be_encode", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("utf_32_be_encode", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2282,7 +2282,7 @@ _codecs_utf_32_be_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("utf_32_be_encode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("utf_32_be_encode", "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2315,7 +2315,7 @@ _codecs_unicode_escape_encode(PyObject *module, PyObject *const *args, Py_ssize_ goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("unicode_escape_encode", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("unicode_escape_encode", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2340,7 +2340,7 @@ _codecs_unicode_escape_encode(PyObject *module, PyObject *const *args, Py_ssize_ } } else { - _PyArg_BadArgument("unicode_escape_encode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("unicode_escape_encode", "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2373,7 +2373,7 @@ _codecs_raw_unicode_escape_encode(PyObject *module, PyObject *const *args, Py_ss goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("raw_unicode_escape_encode", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("raw_unicode_escape_encode", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2398,7 +2398,7 @@ _codecs_raw_unicode_escape_encode(PyObject *module, PyObject *const *args, Py_ss } } else { - _PyArg_BadArgument("raw_unicode_escape_encode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("raw_unicode_escape_encode", "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2431,7 +2431,7 @@ _codecs_latin_1_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("latin_1_encode", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("latin_1_encode", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2456,7 +2456,7 @@ _codecs_latin_1_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs } } else { - _PyArg_BadArgument("latin_1_encode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("latin_1_encode", "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2489,7 +2489,7 @@ _codecs_ascii_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("ascii_encode", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("ascii_encode", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2514,7 +2514,7 @@ _codecs_ascii_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("ascii_encode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("ascii_encode", "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2548,7 +2548,7 @@ _codecs_charmap_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("charmap_encode", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("charmap_encode", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2573,7 +2573,7 @@ _codecs_charmap_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs } } else { - _PyArg_BadArgument("charmap_encode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("charmap_encode", "argument 2", "str or None", args[1]); goto exit; } if (nargs < 3) { @@ -2605,7 +2605,7 @@ _codecs_charmap_build(PyObject *module, PyObject *arg) PyObject *map; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("charmap_build", 0, "argument", "str", arg); + _PyArg_BadArgument("charmap_build", "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -2642,7 +2642,7 @@ _codecs_mbcs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("mbcs_encode", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("mbcs_encode", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2667,7 +2667,7 @@ _codecs_mbcs_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("mbcs_encode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("mbcs_encode", "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2703,7 +2703,7 @@ _codecs_oem_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("oem_encode", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("oem_encode", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -2728,7 +2728,7 @@ _codecs_oem_encode(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("oem_encode", 2, "argument 2", "str or None", args[1]); + _PyArg_BadArgument("oem_encode", "argument 2", "str or None", args[1]); goto exit; } skip_optional: @@ -2775,7 +2775,7 @@ _codecs_code_page_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("code_page_encode", 2, "argument 2", "str", args[1]); + _PyArg_BadArgument("code_page_encode", "argument 2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -2800,7 +2800,7 @@ _codecs_code_page_encode(PyObject *module, PyObject *const *args, Py_ssize_t nar } } else { - _PyArg_BadArgument("code_page_encode", 3, "argument 3", "str or None", args[2]); + _PyArg_BadArgument("code_page_encode", "argument 3", "str or None", args[2]); goto exit; } skip_optional: @@ -2840,7 +2840,7 @@ _codecs_register_error(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("register_error", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("register_error", "argument 1", "str", args[0]); goto exit; } Py_ssize_t errors_length; @@ -2881,7 +2881,7 @@ _codecs_lookup_error(PyObject *module, PyObject *arg) const char *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("lookup_error", 0, "argument", "str", arg); + _PyArg_BadArgument("lookup_error", "argument", "str", arg); goto exit; } Py_ssize_t name_length; @@ -2922,4 +2922,4 @@ _codecs_lookup_error(PyObject *module, PyObject *arg) #ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF #define _CODECS_CODE_PAGE_ENCODE_METHODDEF #endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */ -/*[clinic end generated code: output=421563186b21a798 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=59726a305e4ec24a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_cryptmodule.c.h b/Modules/clinic/_cryptmodule.c.h index 86c7a359c72d5f..ea91d7c130b8cd 100644 --- a/Modules/clinic/_cryptmodule.c.h +++ b/Modules/clinic/_cryptmodule.c.h @@ -30,7 +30,7 @@ crypt_crypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("crypt", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("crypt", "argument 1", "str", args[0]); goto exit; } Py_ssize_t word_length; @@ -43,7 +43,7 @@ crypt_crypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("crypt", 2, "argument 2", "str", args[1]); + _PyArg_BadArgument("crypt", "argument 2", "str", args[1]); goto exit; } Py_ssize_t salt_length; @@ -60,4 +60,4 @@ crypt_crypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=2852ce911bcdd087 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=549de0d43b030126 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_curses_panel.c.h b/Modules/clinic/_curses_panel.c.h index 22208914db5050..9840ed86e79129 100644 --- a/Modules/clinic/_curses_panel.c.h +++ b/Modules/clinic/_curses_panel.c.h @@ -214,7 +214,7 @@ _curses_panel_panel_replace(PyCursesPanelObject *self, PyObject *arg) PyCursesWindowObject *win; if (!PyObject_TypeCheck(arg, &PyCursesWindow_Type)) { - _PyArg_BadArgument("replace", 0, "argument", (&PyCursesWindow_Type)->tp_name, arg); + _PyArg_BadArgument("replace", "argument", (&PyCursesWindow_Type)->tp_name, arg); goto exit; } win = (PyCursesWindowObject *)arg; @@ -288,7 +288,7 @@ _curses_panel_new_panel(PyObject *module, PyObject *arg) PyCursesWindowObject *win; if (!PyObject_TypeCheck(arg, &PyCursesWindow_Type)) { - _PyArg_BadArgument("new_panel", 0, "argument", (&PyCursesWindow_Type)->tp_name, arg); + _PyArg_BadArgument("new_panel", "argument", (&PyCursesWindow_Type)->tp_name, arg); goto exit; } win = (PyCursesWindowObject *)arg; @@ -335,4 +335,4 @@ _curses_panel_update_panels(PyObject *module, PyObject *Py_UNUSED(ignored)) { return _curses_panel_update_panels_impl(module); } -/*[clinic end generated code: output=5c0578d645fc9688 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d96dc1fd68e898d9 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_cursesmodule.c.h b/Modules/clinic/_cursesmodule.c.h index a2036dc7f186c1..ad93e6a0ca0220 100644 --- a/Modules/clinic/_cursesmodule.c.h +++ b/Modules/clinic/_cursesmodule.c.h @@ -2521,7 +2521,7 @@ _curses_ungetmouse(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyLong_Check(args[4])) { - _PyArg_BadArgument("ungetmouse", 5, "argument 5", "int", args[4]); + _PyArg_BadArgument("ungetmouse", "argument 5", "int", args[4]); goto exit; } bstate = PyLong_AsUnsignedLongMask(args[4]); @@ -3017,7 +3017,7 @@ _curses_setupterm(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO } } else { - _PyArg_BadArgument("setupterm", 1, "argument 'term'", "str or None", args[0]); + _PyArg_BadArgument("setupterm", "argument 'term'", "str or None", args[0]); goto exit; } if (!--noptargs) { @@ -3326,7 +3326,7 @@ _curses_mousemask(PyObject *module, PyObject *arg) unsigned long newmask; if (!PyLong_Check(arg)) { - _PyArg_BadArgument("mousemask", 0, "argument", "int", arg); + _PyArg_BadArgument("mousemask", "argument", "int", arg); goto exit; } newmask = PyLong_AsUnsignedLongMask(arg); @@ -4201,7 +4201,7 @@ _curses_tigetflag(PyObject *module, PyObject *arg) const char *capname; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("tigetflag", 0, "argument", "str", arg); + _PyArg_BadArgument("tigetflag", "argument", "str", arg); goto exit; } Py_ssize_t capname_length; @@ -4244,7 +4244,7 @@ _curses_tigetnum(PyObject *module, PyObject *arg) const char *capname; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("tigetnum", 0, "argument", "str", arg); + _PyArg_BadArgument("tigetnum", "argument", "str", arg); goto exit; } Py_ssize_t capname_length; @@ -4287,7 +4287,7 @@ _curses_tigetstr(PyObject *module, PyObject *arg) const char *capname; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("tigetstr", 0, "argument", "str", arg); + _PyArg_BadArgument("tigetstr", "argument", "str", arg); goto exit; } Py_ssize_t capname_length; @@ -4569,4 +4569,4 @@ _curses_use_default_colors(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef _CURSES_USE_DEFAULT_COLORS_METHODDEF #define _CURSES_USE_DEFAULT_COLORS_METHODDEF #endif /* !defined(_CURSES_USE_DEFAULT_COLORS_METHODDEF) */ -/*[clinic end generated code: output=d9d73b7b67072df0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e5b3502f1d38dff0 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_dbmmodule.c.h b/Modules/clinic/_dbmmodule.c.h index b03c3df2d9e3ac..a7d735085068de 100644 --- a/Modules/clinic/_dbmmodule.c.h +++ b/Modules/clinic/_dbmmodule.c.h @@ -136,7 +136,7 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("open", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("open", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -147,7 +147,7 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("open", 2, "argument 2", "str", args[1]); + _PyArg_BadArgument("open", "argument 2", "str", args[1]); goto exit; } Py_ssize_t flags_length; @@ -177,4 +177,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=80913e23c097cba2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7ced103488cbca7a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_elementtree.c.h b/Modules/clinic/_elementtree.c.h index 48eddb30ed75e6..324e549d486a44 100644 --- a/Modules/clinic/_elementtree.c.h +++ b/Modules/clinic/_elementtree.c.h @@ -20,7 +20,7 @@ _elementtree_Element_append(ElementObject *self, PyObject *arg) PyObject *subelement; if (!PyObject_TypeCheck(arg, &Element_Type)) { - _PyArg_BadArgument("append", 0, "argument", (&Element_Type)->tp_name, arg); + _PyArg_BadArgument("append", "argument", (&Element_Type)->tp_name, arg); goto exit; } subelement = arg; @@ -82,7 +82,7 @@ _elementtree_Element___deepcopy__(ElementObject *self, PyObject *arg) PyObject *memo; if (!PyDict_Check(arg)) { - _PyArg_BadArgument("__deepcopy__", 0, "argument", "dict", arg); + _PyArg_BadArgument("__deepcopy__", "argument", "dict", arg); goto exit; } memo = arg; @@ -501,7 +501,7 @@ _elementtree_Element_insert(ElementObject *self, PyObject *const *args, Py_ssize index = ival; } if (!PyObject_TypeCheck(args[1], &Element_Type)) { - _PyArg_BadArgument("insert", 2, "argument 2", (&Element_Type)->tp_name, args[1]); + _PyArg_BadArgument("insert", "argument 2", (&Element_Type)->tp_name, args[1]); goto exit; } subelement = args[1]; @@ -593,7 +593,7 @@ _elementtree_Element_remove(ElementObject *self, PyObject *arg) PyObject *subelement; if (!PyObject_TypeCheck(arg, &Element_Type)) { - _PyArg_BadArgument("remove", 0, "argument", (&Element_Type)->tp_name, arg); + _PyArg_BadArgument("remove", "argument", (&Element_Type)->tp_name, arg); goto exit; } subelement = arg; @@ -892,7 +892,7 @@ _elementtree_XMLParser___init__(PyObject *self, PyObject *args, PyObject *kwargs } } else { - _PyArg_BadArgument("XMLParser", 2, "argument 'encoding'", "str or None", fastargs[1]); + _PyArg_BadArgument("XMLParser", "argument 'encoding'", "str or None", fastargs[1]); goto exit; } skip_optional_kwonly: @@ -969,4 +969,4 @@ _elementtree_XMLParser__setevents(XMLParserObject *self, PyObject *const *args, exit: return return_value; } -/*[clinic end generated code: output=eb4be5e90f6d2dc1 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=50e0b1954c5f9e0f input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_gdbmmodule.c.h b/Modules/clinic/_gdbmmodule.c.h index 81e5a89b9ae051..aa37a24d3b2115 100644 --- a/Modules/clinic/_gdbmmodule.c.h +++ b/Modules/clinic/_gdbmmodule.c.h @@ -257,7 +257,7 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("open", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("open", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -268,7 +268,7 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("open", 2, "argument 2", "str", args[1]); + _PyArg_BadArgument("open", "argument 2", "str", args[1]); goto exit; } Py_ssize_t flags_length; @@ -298,4 +298,4 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=70dd3dc96ca4de1c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=2766471b2fa1a816 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_hashopenssl.c.h b/Modules/clinic/_hashopenssl.c.h index cd99a981d63efb..6377e18ece7a60 100644 --- a/Modules/clinic/_hashopenssl.c.h +++ b/Modules/clinic/_hashopenssl.c.h @@ -145,7 +145,7 @@ pbkdf2_hmac(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("pbkdf2_hmac", 1, "argument 'hash_name'", "str", args[0]); + _PyArg_BadArgument("pbkdf2_hmac", "argument 'hash_name'", "str", args[0]); goto exit; } Py_ssize_t hash_name_length; @@ -161,14 +161,14 @@ pbkdf2_hmac(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyBuffer_IsContiguous(&password, 'C')) { - _PyArg_BadArgument("pbkdf2_hmac", 2, "argument 'password'", "contiguous buffer", args[1]); + _PyArg_BadArgument("pbkdf2_hmac", "argument 'password'", "contiguous buffer", args[1]); goto exit; } if (PyObject_GetBuffer(args[2], &salt, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&salt, 'C')) { - _PyArg_BadArgument("pbkdf2_hmac", 3, "argument 'salt'", "contiguous buffer", args[2]); + _PyArg_BadArgument("pbkdf2_hmac", "argument 'salt'", "contiguous buffer", args[2]); goto exit; } if (PyFloat_Check(args[3])) { @@ -243,7 +243,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&password, 'C')) { - _PyArg_BadArgument("scrypt", 1, "argument 'password'", "contiguous buffer", args[0]); + _PyArg_BadArgument("scrypt", "argument 'password'", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -254,7 +254,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&salt, 'C')) { - _PyArg_BadArgument("scrypt", 2, "argument 'salt'", "contiguous buffer", args[1]); + _PyArg_BadArgument("scrypt", "argument 'salt'", "contiguous buffer", args[1]); goto exit; } if (!--noptargs) { @@ -263,7 +263,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj } if (args[2]) { if (!PyLong_Check(args[2])) { - _PyArg_BadArgument("scrypt", 3, "argument 'n'", "int", args[2]); + _PyArg_BadArgument("scrypt", "argument 'n'", "int", args[2]); goto exit; } n_obj = args[2]; @@ -273,7 +273,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj } if (args[3]) { if (!PyLong_Check(args[3])) { - _PyArg_BadArgument("scrypt", 4, "argument 'r'", "int", args[3]); + _PyArg_BadArgument("scrypt", "argument 'r'", "int", args[3]); goto exit; } r_obj = args[3]; @@ -283,7 +283,7 @@ _hashlib_scrypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj } if (args[4]) { if (!PyLong_Check(args[4])) { - _PyArg_BadArgument("scrypt", 5, "argument 'p'", "int", args[4]); + _PyArg_BadArgument("scrypt", "argument 'p'", "int", args[4]); goto exit; } p_obj = args[4]; @@ -364,18 +364,18 @@ _hashlib_hmac_digest(PyObject *module, PyObject *const *args, Py_ssize_t nargs, goto exit; } if (!PyBuffer_IsContiguous(&key, 'C')) { - _PyArg_BadArgument("hmac_digest", 1, "argument 'key'", "contiguous buffer", args[0]); + _PyArg_BadArgument("hmac_digest", "argument 'key'", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &msg, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&msg, 'C')) { - _PyArg_BadArgument("hmac_digest", 2, "argument 'msg'", "contiguous buffer", args[1]); + _PyArg_BadArgument("hmac_digest", "argument 'msg'", "contiguous buffer", args[1]); goto exit; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("hmac_digest", 3, "argument 'digest'", "str", args[2]); + _PyArg_BadArgument("hmac_digest", "argument 'digest'", "str", args[2]); goto exit; } Py_ssize_t digest_length; @@ -409,4 +409,4 @@ _hashlib_hmac_digest(PyObject *module, PyObject *const *args, Py_ssize_t nargs, #ifndef _HASHLIB_SCRYPT_METHODDEF #define _HASHLIB_SCRYPT_METHODDEF #endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */ -/*[clinic end generated code: output=bc9ece72b44434fa input=a9049054013a1b77]*/ +/*[clinic end generated code: output=565dcbe3452e71f4 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_lzmamodule.c.h b/Modules/clinic/_lzmamodule.c.h index f08e7aa3b0d6ef..82ef4d517d83c5 100644 --- a/Modules/clinic/_lzmamodule.c.h +++ b/Modules/clinic/_lzmamodule.c.h @@ -29,7 +29,7 @@ _lzma_LZMACompressor_compress(Compressor *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("compress", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("compress", "argument", "contiguous buffer", arg); goto exit; } return_value = _lzma_LZMACompressor_compress_impl(self, &data); @@ -110,7 +110,7 @@ _lzma_LZMADecompressor_decompress(Decompressor *self, PyObject *const *args, Py_ goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("decompress", 1, "argument 'data'", "contiguous buffer", args[0]); + _PyArg_BadArgument("decompress", "argument 'data'", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -321,7 +321,7 @@ _lzma__decode_filter_properties(PyObject *module, PyObject *const *args, Py_ssiz goto exit; } if (!PyBuffer_IsContiguous(&encoded_props, 'C')) { - _PyArg_BadArgument("_decode_filter_properties", 2, "argument 2", "contiguous buffer", args[1]); + _PyArg_BadArgument("_decode_filter_properties", "argument 2", "contiguous buffer", args[1]); goto exit; } return_value = _lzma__decode_filter_properties_impl(module, filter_id, &encoded_props); @@ -334,4 +334,4 @@ _lzma__decode_filter_properties(PyObject *module, PyObject *const *args, Py_ssiz return return_value; } -/*[clinic end generated code: output=3542c05a754219ec input=a9049054013a1b77]*/ +/*[clinic end generated code: output=f7477a10e86a717d input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_pickle.c.h b/Modules/clinic/_pickle.c.h index a26c24f80665e0..b92daa72105a61 100644 --- a/Modules/clinic/_pickle.c.h +++ b/Modules/clinic/_pickle.c.h @@ -356,7 +356,7 @@ _pickle_Unpickler___init__(PyObject *self, PyObject *args, PyObject *kwargs) } if (fastargs[2]) { if (!PyUnicode_Check(fastargs[2])) { - _PyArg_BadArgument("Unpickler", 3, "argument 'encoding'", "str", fastargs[2]); + _PyArg_BadArgument("Unpickler", "argument 'encoding'", "str", fastargs[2]); goto exit; } Py_ssize_t encoding_length; @@ -374,7 +374,7 @@ _pickle_Unpickler___init__(PyObject *self, PyObject *args, PyObject *kwargs) } if (fastargs[3]) { if (!PyUnicode_Check(fastargs[3])) { - _PyArg_BadArgument("Unpickler", 4, "argument 'errors'", "str", fastargs[3]); + _PyArg_BadArgument("Unpickler", "argument 'errors'", "str", fastargs[3]); goto exit; } Py_ssize_t errors_length; @@ -691,7 +691,7 @@ _pickle_load(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject } if (args[2]) { if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("load", 3, "argument 'encoding'", "str", args[2]); + _PyArg_BadArgument("load", "argument 'encoding'", "str", args[2]); goto exit; } Py_ssize_t encoding_length; @@ -709,7 +709,7 @@ _pickle_load(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject } if (args[3]) { if (!PyUnicode_Check(args[3])) { - _PyArg_BadArgument("load", 4, "argument 'errors'", "str", args[3]); + _PyArg_BadArgument("load", "argument 'errors'", "str", args[3]); goto exit; } Py_ssize_t errors_length; @@ -794,7 +794,7 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec } if (args[2]) { if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("loads", 3, "argument 'encoding'", "str", args[2]); + _PyArg_BadArgument("loads", "argument 'encoding'", "str", args[2]); goto exit; } Py_ssize_t encoding_length; @@ -812,7 +812,7 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec } if (args[3]) { if (!PyUnicode_Check(args[3])) { - _PyArg_BadArgument("loads", 4, "argument 'errors'", "str", args[3]); + _PyArg_BadArgument("loads", "argument 'errors'", "str", args[3]); goto exit; } Py_ssize_t errors_length; @@ -835,4 +835,4 @@ _pickle_loads(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec exit: return return_value; } -/*[clinic end generated code: output=eb5b6b91fd952802 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=17f6a76ebd94325d input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_sre.c.h b/Modules/clinic/_sre.c.h index bcc779e26c2ad0..d398a8504ba418 100644 --- a/Modules/clinic/_sre.c.h +++ b/Modules/clinic/_sre.c.h @@ -894,7 +894,7 @@ _sre_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyList_Check(args[2])) { - _PyArg_BadArgument("compile", 3, "argument 'code'", "list", args[2]); + _PyArg_BadArgument("compile", "argument 'code'", "list", args[2]); goto exit; } code = args[2]; @@ -916,12 +916,12 @@ _sre_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject groups = ival; } if (!PyDict_Check(args[4])) { - _PyArg_BadArgument("compile", 5, "argument 'groupindex'", "dict", args[4]); + _PyArg_BadArgument("compile", "argument 'groupindex'", "dict", args[4]); goto exit; } groupindex = args[4]; if (!PyTuple_Check(args[5])) { - _PyArg_BadArgument("compile", 6, "argument 'indexgroup'", "tuple", args[5]); + _PyArg_BadArgument("compile", "argument 'indexgroup'", "tuple", args[5]); goto exit; } indexgroup = args[5]; @@ -1207,4 +1207,4 @@ _sre_SRE_Scanner_search(ScannerObject *self, PyObject *Py_UNUSED(ignored)) { return _sre_SRE_Scanner_search_impl(self); } -/*[clinic end generated code: output=a89e3c01563007e2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1adeddce58ae284c input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_ssl.c.h b/Modules/clinic/_ssl.c.h index 4716aef3fe0237..e26b004dd2f80b 100644 --- a/Modules/clinic/_ssl.c.h +++ b/Modules/clinic/_ssl.c.h @@ -222,7 +222,7 @@ _ssl__SSLSocket_write(PySSLSocket *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&b, 'C')) { - _PyArg_BadArgument("write", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("write", "argument", "contiguous buffer", arg); goto exit; } return_value = _ssl__SSLSocket_write_impl(self, &b); @@ -353,7 +353,7 @@ _ssl__SSLSocket_get_channel_binding(PySSLSocket *self, PyObject *const *args, Py goto skip_optional_pos; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("get_channel_binding", 1, "argument 'cb_type'", "str", args[0]); + _PyArg_BadArgument("get_channel_binding", "argument 'cb_type'", "str", args[0]); goto exit; } Py_ssize_t cb_type_length; @@ -439,7 +439,7 @@ _ssl__SSLContext_set_ciphers(PySSLContext *self, PyObject *arg) const char *cipherlist; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("set_ciphers", 0, "argument", "str", arg); + _PyArg_BadArgument("set_ciphers", "argument", "str", arg); goto exit; } Py_ssize_t cipherlist_length; @@ -500,7 +500,7 @@ _ssl__SSLContext__set_npn_protocols(PySSLContext *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&protos, 'C')) { - _PyArg_BadArgument("_set_npn_protocols", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("_set_npn_protocols", "argument", "contiguous buffer", arg); goto exit; } return_value = _ssl__SSLContext__set_npn_protocols_impl(self, &protos); @@ -536,7 +536,7 @@ _ssl__SSLContext__set_alpn_protocols(PySSLContext *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&protos, 'C')) { - _PyArg_BadArgument("_set_alpn_protocols", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("_set_alpn_protocols", "argument", "contiguous buffer", arg); goto exit; } return_value = _ssl__SSLContext__set_alpn_protocols_impl(self, &protos); @@ -690,7 +690,7 @@ _ssl__SSLContext__wrap_socket(PySSLContext *self, PyObject *const *args, Py_ssiz goto exit; } if (!PyObject_TypeCheck(args[0], PySocketModule.Sock_Type)) { - _PyArg_BadArgument("_wrap_socket", 1, "argument 'sock'", (PySocketModule.Sock_Type)->tp_name, args[0]); + _PyArg_BadArgument("_wrap_socket", "argument 'sock'", (PySocketModule.Sock_Type)->tp_name, args[0]); goto exit; } sock = args[0]; @@ -765,12 +765,12 @@ _ssl__SSLContext__wrap_bio(PySSLContext *self, PyObject *const *args, Py_ssize_t goto exit; } if (!PyObject_TypeCheck(args[0], &PySSLMemoryBIO_Type)) { - _PyArg_BadArgument("_wrap_bio", 1, "argument 'incoming'", (&PySSLMemoryBIO_Type)->tp_name, args[0]); + _PyArg_BadArgument("_wrap_bio", "argument 'incoming'", (&PySSLMemoryBIO_Type)->tp_name, args[0]); goto exit; } incoming = (PySSLMemoryBIO *)args[0]; if (!PyObject_TypeCheck(args[1], &PySSLMemoryBIO_Type)) { - _PyArg_BadArgument("_wrap_bio", 2, "argument 'outgoing'", (&PySSLMemoryBIO_Type)->tp_name, args[1]); + _PyArg_BadArgument("_wrap_bio", "argument 'outgoing'", (&PySSLMemoryBIO_Type)->tp_name, args[1]); goto exit; } outgoing = (PySSLMemoryBIO *)args[1]; @@ -1017,7 +1017,7 @@ _ssl_MemoryBIO_write(PySSLMemoryBIO *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&b, 'C')) { - _PyArg_BadArgument("write", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("write", "argument", "contiguous buffer", arg); goto exit; } return_value = _ssl_MemoryBIO_write_impl(self, &b); @@ -1089,7 +1089,7 @@ _ssl_RAND_add(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&view, 'C')) { - _PyArg_BadArgument("RAND_add", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("RAND_add", "argument 1", "contiguous buffer", args[0]); goto exit; } } @@ -1283,7 +1283,7 @@ _ssl_txt2obj(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("txt2obj", 1, "argument 'txt'", "str", args[0]); + _PyArg_BadArgument("txt2obj", "argument 'txt'", "str", args[0]); goto exit; } Py_ssize_t txt_length; @@ -1376,7 +1376,7 @@ _ssl_enum_certificates(PyObject *module, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("enum_certificates", 1, "argument 'store_name'", "str", args[0]); + _PyArg_BadArgument("enum_certificates", "argument 'store_name'", "str", args[0]); goto exit; } Py_ssize_t store_name_length; @@ -1429,7 +1429,7 @@ _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("enum_crls", 1, "argument 'store_name'", "str", args[0]); + _PyArg_BadArgument("enum_crls", "argument 'store_name'", "str", args[0]); goto exit; } Py_ssize_t store_name_length; @@ -1476,4 +1476,4 @@ _ssl_enum_crls(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObje #ifndef _SSL_ENUM_CRLS_METHODDEF #define _SSL_ENUM_CRLS_METHODDEF #endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */ -/*[clinic end generated code: output=7a34c9b61c98c2eb input=a9049054013a1b77]*/ +/*[clinic end generated code: output=88eb657b57e6ca0a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_struct.c.h b/Modules/clinic/_struct.c.h index d5756371dd9d92..36c4b4046cd739 100644 --- a/Modules/clinic/_struct.c.h +++ b/Modules/clinic/_struct.c.h @@ -65,7 +65,7 @@ Struct_unpack(PyStructObject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("unpack", "argument", "contiguous buffer", arg); goto exit; } return_value = Struct_unpack_impl(self, &buffer); @@ -118,7 +118,7 @@ Struct_unpack_from(PyStructObject *self, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack_from", 1, "argument 'buffer'", "contiguous buffer", args[0]); + _PyArg_BadArgument("unpack_from", "argument 'buffer'", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -253,7 +253,7 @@ unpack(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack", 2, "argument 2", "contiguous buffer", args[1]); + _PyArg_BadArgument("unpack", "argument 2", "contiguous buffer", args[1]); goto exit; } return_value = unpack_impl(module, s_object, &buffer); @@ -309,7 +309,7 @@ unpack_from(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("unpack_from", 2, "argument 'buffer'", "contiguous buffer", args[1]); + _PyArg_BadArgument("unpack_from", "argument 'buffer'", "contiguous buffer", args[1]); goto exit; } if (!noptargs) { @@ -386,4 +386,4 @@ iter_unpack(PyObject *module, PyObject *const *args, Py_ssize_t nargs) return return_value; } -/*[clinic end generated code: output=7c2cf3525d53e012 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6a6228cfc4b7099c input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_tkinter.c.h b/Modules/clinic/_tkinter.c.h index 17304a4270652c..4870e9b4aad77b 100644 --- a/Modules/clinic/_tkinter.c.h +++ b/Modules/clinic/_tkinter.c.h @@ -20,7 +20,7 @@ _tkinter_tkapp_eval(TkappObject *self, PyObject *arg) const char *script; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("eval", 0, "argument", "str", arg); + _PyArg_BadArgument("eval", "argument", "str", arg); goto exit; } Py_ssize_t script_length; @@ -56,7 +56,7 @@ _tkinter_tkapp_evalfile(TkappObject *self, PyObject *arg) const char *fileName; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("evalfile", 0, "argument", "str", arg); + _PyArg_BadArgument("evalfile", "argument", "str", arg); goto exit; } Py_ssize_t fileName_length; @@ -92,7 +92,7 @@ _tkinter_tkapp_record(TkappObject *self, PyObject *arg) const char *script; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("record", 0, "argument", "str", arg); + _PyArg_BadArgument("record", "argument", "str", arg); goto exit; } Py_ssize_t script_length; @@ -128,7 +128,7 @@ _tkinter_tkapp_adderrorinfo(TkappObject *self, PyObject *arg) const char *msg; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("adderrorinfo", 0, "argument", "str", arg); + _PyArg_BadArgument("adderrorinfo", "argument", "str", arg); goto exit; } Py_ssize_t msg_length; @@ -188,7 +188,7 @@ _tkinter_tkapp_exprstring(TkappObject *self, PyObject *arg) const char *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("exprstring", 0, "argument", "str", arg); + _PyArg_BadArgument("exprstring", "argument", "str", arg); goto exit; } Py_ssize_t s_length; @@ -224,7 +224,7 @@ _tkinter_tkapp_exprlong(TkappObject *self, PyObject *arg) const char *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("exprlong", 0, "argument", "str", arg); + _PyArg_BadArgument("exprlong", "argument", "str", arg); goto exit; } Py_ssize_t s_length; @@ -260,7 +260,7 @@ _tkinter_tkapp_exprdouble(TkappObject *self, PyObject *arg) const char *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("exprdouble", 0, "argument", "str", arg); + _PyArg_BadArgument("exprdouble", "argument", "str", arg); goto exit; } Py_ssize_t s_length; @@ -296,7 +296,7 @@ _tkinter_tkapp_exprboolean(TkappObject *self, PyObject *arg) const char *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("exprboolean", 0, "argument", "str", arg); + _PyArg_BadArgument("exprboolean", "argument", "str", arg); goto exit; } Py_ssize_t s_length; @@ -353,7 +353,7 @@ _tkinter_tkapp_createcommand(TkappObject *self, PyObject *const *args, Py_ssize_ goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("createcommand", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("createcommand", "argument 1", "str", args[0]); goto exit; } Py_ssize_t name_length; @@ -390,7 +390,7 @@ _tkinter_tkapp_deletecommand(TkappObject *self, PyObject *arg) const char *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("deletecommand", 0, "argument", "str", arg); + _PyArg_BadArgument("deletecommand", "argument", "str", arg); goto exit; } Py_ssize_t name_length; @@ -731,14 +731,14 @@ _tkinter_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("create", 1, "argument 1", "str or None", args[0]); + _PyArg_BadArgument("create", "argument 1", "str or None", args[0]); goto exit; } if (nargs < 2) { goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("create", 2, "argument 2", "str", args[1]); + _PyArg_BadArgument("create", "argument 2", "str", args[1]); goto exit; } Py_ssize_t baseName_length; @@ -754,7 +754,7 @@ _tkinter_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("create", 3, "argument 3", "str", args[2]); + _PyArg_BadArgument("create", "argument 3", "str", args[2]); goto exit; } Py_ssize_t className_length; @@ -832,7 +832,7 @@ _tkinter_create(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } } else { - _PyArg_BadArgument("create", 8, "argument 8", "str or None", args[7]); + _PyArg_BadArgument("create", "argument 8", "str or None", args[7]); goto exit; } skip_optional: @@ -912,4 +912,4 @@ _tkinter_getbusywaitinterval(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF #endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */ -/*[clinic end generated code: output=c2f9c5e9da1a5c73 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=da0115c470aac1c0 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/_weakref.c.h b/Modules/clinic/_weakref.c.h index d9746d8cf2d0a9..c3a908fa6a139e 100644 --- a/Modules/clinic/_weakref.c.h +++ b/Modules/clinic/_weakref.c.h @@ -54,7 +54,7 @@ _weakref__remove_dead_weakref(PyObject *module, PyObject *const *args, Py_ssize_ goto exit; } if (!PyDict_Check(args[0])) { - _PyArg_BadArgument("_remove_dead_weakref", 1, "argument 1", "dict", args[0]); + _PyArg_BadArgument("_remove_dead_weakref", "argument 1", "dict", args[0]); goto exit; } dct = args[0]; @@ -64,4 +64,4 @@ _weakref__remove_dead_weakref(PyObject *module, PyObject *const *args, Py_ssize_ exit: return return_value; } -/*[clinic end generated code: output=0d3c39fed9e01436 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=c543dc2cd6ece975 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/arraymodule.c.h b/Modules/clinic/arraymodule.c.h index 4f4680eb21db43..33f82d4da8b6c9 100644 --- a/Modules/clinic/arraymodule.c.h +++ b/Modules/clinic/arraymodule.c.h @@ -345,7 +345,7 @@ array_array_fromstring(arrayobject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("fromstring", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("fromstring", "argument", "contiguous buffer", arg); goto exit; } } @@ -382,7 +382,7 @@ array_array_frombytes(arrayobject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("frombytes", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("frombytes", "argument", "contiguous buffer", arg); goto exit; } return_value = array_array_frombytes_impl(self, &buffer); @@ -537,14 +537,14 @@ array__array_reconstructor(PyObject *module, PyObject *const *args, Py_ssize_t n } arraytype = (PyTypeObject *)args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("_array_reconstructor", 2, "argument 2", "a unicode character", args[1]); + _PyArg_BadArgument("_array_reconstructor", "argument 2", "a unicode character", args[1]); goto exit; } if (PyUnicode_READY(args[1])) { goto exit; } if (PyUnicode_GET_LENGTH(args[1]) != 1) { - _PyArg_BadArgument("_array_reconstructor", 2, "argument 2", "a unicode character", args[1]); + _PyArg_BadArgument("_array_reconstructor", "argument 2", "a unicode character", args[1]); goto exit; } typecode = PyUnicode_READ_CHAR(args[1], 0); @@ -599,4 +599,4 @@ PyDoc_STRVAR(array_arrayiterator___setstate____doc__, #define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \ {"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__}, -/*[clinic end generated code: output=3509df49a81ae0c0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6aa421571e2c0756 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/audioop.c.h b/Modules/clinic/audioop.c.h index d70d5d691e4f52..2305b6d4d5f816 100644 --- a/Modules/clinic/audioop.c.h +++ b/Modules/clinic/audioop.c.h @@ -30,7 +30,7 @@ audioop_getsample(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("getsample", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("getsample", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -96,7 +96,7 @@ audioop_max(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("max", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("max", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -145,7 +145,7 @@ audioop_minmax(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("minmax", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("minmax", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -194,7 +194,7 @@ audioop_avg(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("avg", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("avg", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -243,7 +243,7 @@ audioop_rms(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("rms", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("rms", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -293,14 +293,14 @@ audioop_findfit(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("findfit", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("findfit", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &reference, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&reference, 'C')) { - _PyArg_BadArgument("findfit", 2, "argument 2", "contiguous buffer", args[1]); + _PyArg_BadArgument("findfit", "argument 2", "contiguous buffer", args[1]); goto exit; } return_value = audioop_findfit_impl(module, &fragment, &reference); @@ -345,14 +345,14 @@ audioop_findfactor(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("findfactor", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("findfactor", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &reference, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&reference, 'C')) { - _PyArg_BadArgument("findfactor", 2, "argument 2", "contiguous buffer", args[1]); + _PyArg_BadArgument("findfactor", "argument 2", "contiguous buffer", args[1]); goto exit; } return_value = audioop_findfactor_impl(module, &fragment, &reference); @@ -397,7 +397,7 @@ audioop_findmax(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("findmax", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("findmax", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -454,7 +454,7 @@ audioop_avgpp(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("avgpp", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("avgpp", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -503,7 +503,7 @@ audioop_maxpp(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("maxpp", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("maxpp", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -552,7 +552,7 @@ audioop_cross(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("cross", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("cross", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -603,7 +603,7 @@ audioop_mul(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("mul", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("mul", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -659,7 +659,7 @@ audioop_tomono(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("tomono", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("tomono", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -719,7 +719,7 @@ audioop_tostereo(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("tostereo", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("tostereo", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -778,14 +778,14 @@ audioop_add(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment1, 'C')) { - _PyArg_BadArgument("add", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("add", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &fragment2, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&fragment2, 'C')) { - _PyArg_BadArgument("add", 2, "argument 2", "contiguous buffer", args[1]); + _PyArg_BadArgument("add", "argument 2", "contiguous buffer", args[1]); goto exit; } if (PyFloat_Check(args[2])) { @@ -839,7 +839,7 @@ audioop_bias(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("bias", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("bias", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -897,7 +897,7 @@ audioop_reverse(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("reverse", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("reverse", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -946,7 +946,7 @@ audioop_byteswap(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("byteswap", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("byteswap", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -997,7 +997,7 @@ audioop_lin2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("lin2lin", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("lin2lin", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1064,7 +1064,7 @@ audioop_ratecv(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("ratecv", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("ratecv", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1166,7 +1166,7 @@ audioop_lin2ulaw(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("lin2ulaw", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("lin2ulaw", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1215,7 +1215,7 @@ audioop_ulaw2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("ulaw2lin", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("ulaw2lin", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1264,7 +1264,7 @@ audioop_lin2alaw(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("lin2alaw", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("lin2alaw", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1313,7 +1313,7 @@ audioop_alaw2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("alaw2lin", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("alaw2lin", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1364,7 +1364,7 @@ audioop_lin2adpcm(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("lin2adpcm", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("lin2adpcm", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1416,7 +1416,7 @@ audioop_adpcm2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&fragment, 'C')) { - _PyArg_BadArgument("adpcm2lin", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("adpcm2lin", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -1439,4 +1439,4 @@ audioop_adpcm2lin(PyObject *module, PyObject *const *args, Py_ssize_t nargs) return return_value; } -/*[clinic end generated code: output=5200371ac4a90260 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ec20d48ea64a13ac input=a9049054013a1b77]*/ diff --git a/Modules/clinic/binascii.c.h b/Modules/clinic/binascii.c.h index a59d13518d40fe..c2cd32041b5705 100644 --- a/Modules/clinic/binascii.c.h +++ b/Modules/clinic/binascii.c.h @@ -64,7 +64,7 @@ binascii_b2a_uu(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_uu", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("b2a_uu", "argument 1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -153,7 +153,7 @@ binascii_b2a_base64(PyObject *module, PyObject *const *args, Py_ssize_t nargs, P goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_base64", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("b2a_base64", "argument 1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -233,7 +233,7 @@ binascii_rlecode_hqx(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("rlecode_hqx", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("rlecode_hqx", "argument", "contiguous buffer", arg); goto exit; } return_value = binascii_rlecode_hqx_impl(module, &data); @@ -269,7 +269,7 @@ binascii_b2a_hqx(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_hqx", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("b2a_hqx", "argument", "contiguous buffer", arg); goto exit; } return_value = binascii_b2a_hqx_impl(module, &data); @@ -305,7 +305,7 @@ binascii_rledecode_hqx(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("rledecode_hqx", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("rledecode_hqx", "argument", "contiguous buffer", arg); goto exit; } return_value = binascii_rledecode_hqx_impl(module, &data); @@ -346,7 +346,7 @@ binascii_crc_hqx(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("crc_hqx", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("crc_hqx", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyFloat_Check(args[1])) { @@ -400,7 +400,7 @@ binascii_crc32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("crc32", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("crc32", "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -456,7 +456,7 @@ binascii_b2a_hex(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_hex", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("b2a_hex", "argument", "contiguous buffer", arg); goto exit; } return_value = binascii_b2a_hex_impl(module, &data); @@ -494,7 +494,7 @@ binascii_hexlify(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("hexlify", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("hexlify", "argument", "contiguous buffer", arg); goto exit; } return_value = binascii_hexlify_impl(module, &data); @@ -666,7 +666,7 @@ binascii_b2a_qp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("b2a_qp", 1, "argument 'data'", "contiguous buffer", args[0]); + _PyArg_BadArgument("b2a_qp", "argument 'data'", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -720,4 +720,4 @@ binascii_b2a_qp(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj return return_value; } -/*[clinic end generated code: output=99ed5c6db16d8d46 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dea4ee349cf8d071 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/grpmodule.c.h b/Modules/clinic/grpmodule.c.h index bdb29b69cd3ade..2e2690ad8d3f11 100644 --- a/Modules/clinic/grpmodule.c.h +++ b/Modules/clinic/grpmodule.c.h @@ -64,7 +64,7 @@ grp_getgrnam(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("getgrnam", 1, "argument 'name'", "str", args[0]); + _PyArg_BadArgument("getgrnam", "argument 'name'", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -97,4 +97,4 @@ grp_getgrall(PyObject *module, PyObject *Py_UNUSED(ignored)) { return grp_getgrall_impl(module); } -/*[clinic end generated code: output=fbbc7c6e8b97da5b input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9b3f26779e4e1a52 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/itertoolsmodule.c.h b/Modules/clinic/itertoolsmodule.c.h index b9e193cbba7d04..20594b0fed4c34 100644 --- a/Modules/clinic/itertoolsmodule.c.h +++ b/Modules/clinic/itertoolsmodule.c.h @@ -66,7 +66,7 @@ itertools__grouper(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyObject_TypeCheck(PyTuple_GET_ITEM(args, 0), &groupby_type)) { - _PyArg_BadArgument("_grouper", 1, "argument 1", (&groupby_type)->tp_name, PyTuple_GET_ITEM(args, 0)); + _PyArg_BadArgument("_grouper", "argument 1", (&groupby_type)->tp_name, PyTuple_GET_ITEM(args, 0)); goto exit; } parent = PyTuple_GET_ITEM(args, 0); @@ -104,7 +104,7 @@ itertools_teedataobject(PyTypeObject *type, PyObject *args, PyObject *kwargs) } it = PyTuple_GET_ITEM(args, 0); if (!PyList_Check(PyTuple_GET_ITEM(args, 1))) { - _PyArg_BadArgument("teedataobject", 2, "argument 2", "list", PyTuple_GET_ITEM(args, 1)); + _PyArg_BadArgument("teedataobject", "argument 2", "list", PyTuple_GET_ITEM(args, 1)); goto exit; } values = PyTuple_GET_ITEM(args, 1); @@ -642,4 +642,4 @@ itertools_count(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=a25e6262aa9a157c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=392c9706e79f6710 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/mathmodule.c.h b/Modules/clinic/mathmodule.c.h index 8f6bc144ccb4a7..36cc8c1568991a 100644 --- a/Modules/clinic/mathmodule.c.h +++ b/Modules/clinic/mathmodule.c.h @@ -320,12 +320,12 @@ math_dist(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyTuple_Check(args[0])) { - _PyArg_BadArgument("dist", 1, "argument 1", "tuple", args[0]); + _PyArg_BadArgument("dist", "argument 1", "tuple", args[0]); goto exit; } p = args[0]; if (!PyTuple_Check(args[1])) { - _PyArg_BadArgument("dist", 2, "argument 2", "tuple", args[1]); + _PyArg_BadArgument("dist", "argument 2", "tuple", args[1]); goto exit; } q = args[1]; @@ -637,4 +637,4 @@ math_prod(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k exit: return return_value; } -/*[clinic end generated code: output=14b3770a922a02b9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=cc9982813b53328c input=a9049054013a1b77]*/ diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index 55728c12b06034..fcc4a6fce19945 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -616,7 +616,7 @@ os_chflags(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject * goto exit; } if (!PyLong_Check(args[1])) { - _PyArg_BadArgument("chflags", 2, "argument 'flags'", "int", args[1]); + _PyArg_BadArgument("chflags", "argument 'flags'", "int", args[1]); goto exit; } flags = PyLong_AsUnsignedLongMask(args[1]); @@ -674,7 +674,7 @@ os_lchflags(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyLong_Check(args[1])) { - _PyArg_BadArgument("lchflags", 2, "argument 'flags'", "int", args[1]); + _PyArg_BadArgument("lchflags", "argument 'flags'", "int", args[1]); goto exit; } flags = PyLong_AsUnsignedLongMask(args[1]); @@ -4969,7 +4969,7 @@ os_write(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("write", 2, "argument 2", "contiguous buffer", args[1]); + _PyArg_BadArgument("write", "argument 2", "contiguous buffer", args[1]); goto exit; } _return_value = os_write_impl(module, fd, &data); @@ -5292,7 +5292,7 @@ os_pwrite(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&buffer, 'C')) { - _PyArg_BadArgument("pwrite", 2, "argument 2", "contiguous buffer", args[1]); + _PyArg_BadArgument("pwrite", "argument 2", "contiguous buffer", args[1]); goto exit; } if (!Py_off_t_converter(args[2], &offset)) { @@ -5923,7 +5923,7 @@ os_putenv(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("putenv", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("putenv", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -5931,7 +5931,7 @@ os_putenv(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } name = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("putenv", 2, "argument 2", "str", args[1]); + _PyArg_BadArgument("putenv", "argument 2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -7127,7 +7127,7 @@ os_setxattr(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject goto exit; } if (!PyBuffer_IsContiguous(&value, 'C')) { - _PyArg_BadArgument("setxattr", 3, "argument 'value'", "contiguous buffer", args[2]); + _PyArg_BadArgument("setxattr", "argument 'value'", "contiguous buffer", args[2]); goto exit; } if (!noptargs) { @@ -8576,4 +8576,4 @@ os__remove_dll_directory(PyObject *module, PyObject *const *args, Py_ssize_t nar #ifndef OS__REMOVE_DLL_DIRECTORY_METHODDEF #define OS__REMOVE_DLL_DIRECTORY_METHODDEF #endif /* !defined(OS__REMOVE_DLL_DIRECTORY_METHODDEF) */ -/*[clinic end generated code: output=0d9b49effa61b7dd input=a9049054013a1b77]*/ +/*[clinic end generated code: output=0389f05c5b9b186f input=a9049054013a1b77]*/ diff --git a/Modules/clinic/pwdmodule.c.h b/Modules/clinic/pwdmodule.c.h index 0ccb714e66627a..cb83062495dcf9 100644 --- a/Modules/clinic/pwdmodule.c.h +++ b/Modules/clinic/pwdmodule.c.h @@ -34,7 +34,7 @@ pwd_getpwnam(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("getpwnam", 0, "argument", "str", arg); + _PyArg_BadArgument("getpwnam", "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -74,4 +74,4 @@ pwd_getpwall(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef PWD_GETPWALL_METHODDEF #define PWD_GETPWALL_METHODDEF #endif /* !defined(PWD_GETPWALL_METHODDEF) */ -/*[clinic end generated code: output=2095c61f4cd3c5c2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7fceab7f1a85da36 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/pyexpat.c.h b/Modules/clinic/pyexpat.c.h index 0165147abe8a9b..41ab536bce23c2 100644 --- a/Modules/clinic/pyexpat.c.h +++ b/Modules/clinic/pyexpat.c.h @@ -75,7 +75,7 @@ pyexpat_xmlparser_SetBase(xmlparseobject *self, PyObject *arg) const char *base; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("SetBase", 0, "argument", "str", arg); + _PyArg_BadArgument("SetBase", "argument", "str", arg); goto exit; } Py_ssize_t base_length; @@ -171,14 +171,14 @@ pyexpat_xmlparser_ExternalEntityParserCreate(xmlparseobject *self, PyObject *con } } else { - _PyArg_BadArgument("ExternalEntityParserCreate", 1, "argument 1", "str or None", args[0]); + _PyArg_BadArgument("ExternalEntityParserCreate", "argument 1", "str or None", args[0]); goto exit; } if (nargs < 2) { goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("ExternalEntityParserCreate", 2, "argument 2", "str", args[1]); + _PyArg_BadArgument("ExternalEntityParserCreate", "argument 2", "str", args[1]); goto exit; } Py_ssize_t encoding_length; @@ -327,7 +327,7 @@ pyexpat_ParserCreate(PyObject *module, PyObject *const *args, Py_ssize_t nargs, } } else { - _PyArg_BadArgument("ParserCreate", 1, "argument 'encoding'", "str or None", args[0]); + _PyArg_BadArgument("ParserCreate", "argument 'encoding'", "str or None", args[0]); goto exit; } if (!--noptargs) { @@ -350,7 +350,7 @@ pyexpat_ParserCreate(PyObject *module, PyObject *const *args, Py_ssize_t nargs, } } else { - _PyArg_BadArgument("ParserCreate", 2, "argument 'namespace_separator'", "str or None", args[1]); + _PyArg_BadArgument("ParserCreate", "argument 'namespace_separator'", "str or None", args[1]); goto exit; } if (!--noptargs) { @@ -401,4 +401,4 @@ pyexpat_ErrorString(PyObject *module, PyObject *arg) #ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF #endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */ -/*[clinic end generated code: output=4d2fd19723be47af input=a9049054013a1b77]*/ +/*[clinic end generated code: output=133a4105d508ebec input=a9049054013a1b77]*/ diff --git a/Modules/clinic/signalmodule.c.h b/Modules/clinic/signalmodule.c.h index 6c2a683a1a7574..3cb1db14878c56 100644 --- a/Modules/clinic/signalmodule.c.h +++ b/Modules/clinic/signalmodule.c.h @@ -590,7 +590,7 @@ signal_pthread_kill(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyLong_Check(args[0])) { - _PyArg_BadArgument("pthread_kill", 1, "argument 1", "int", args[0]); + _PyArg_BadArgument("pthread_kill", "argument 1", "int", args[0]); goto exit; } thread_id = PyLong_AsUnsignedLongMask(args[0]); @@ -658,4 +658,4 @@ signal_pthread_kill(PyObject *module, PyObject *const *args, Py_ssize_t nargs) #ifndef SIGNAL_PTHREAD_KILL_METHODDEF #define SIGNAL_PTHREAD_KILL_METHODDEF #endif /* !defined(SIGNAL_PTHREAD_KILL_METHODDEF) */ -/*[clinic end generated code: output=fdf88e367462e012 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3320b8f73c20ba60 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/spwdmodule.c.h b/Modules/clinic/spwdmodule.c.h index a76281bb125c1d..411d2344e18fba 100644 --- a/Modules/clinic/spwdmodule.c.h +++ b/Modules/clinic/spwdmodule.c.h @@ -25,7 +25,7 @@ spwd_getspnam(PyObject *module, PyObject *arg_) PyObject *arg; if (!PyUnicode_Check(arg_)) { - _PyArg_BadArgument("getspnam", 0, "argument", "str", arg_); + _PyArg_BadArgument("getspnam", "argument", "str", arg_); goto exit; } if (PyUnicode_READY(arg_) == -1) { @@ -71,4 +71,4 @@ spwd_getspall(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef SPWD_GETSPALL_METHODDEF #define SPWD_GETSPALL_METHODDEF #endif /* !defined(SPWD_GETSPALL_METHODDEF) */ -/*[clinic end generated code: output=8edc96053285c7d9 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=eec8d0bedcd312e5 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/symtablemodule.c.h b/Modules/clinic/symtablemodule.c.h index 6968af1722183b..4a17f130ac97bc 100644 --- a/Modules/clinic/symtablemodule.c.h +++ b/Modules/clinic/symtablemodule.c.h @@ -31,7 +31,7 @@ _symtable_symtable(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("symtable", 3, "argument 3", "str", args[2]); + _PyArg_BadArgument("symtable", "argument 3", "str", args[2]); goto exit; } Py_ssize_t startstr_length; @@ -48,4 +48,4 @@ _symtable_symtable(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=2184de982b72c175 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a12f75cdbdf4e52a input=a9049054013a1b77]*/ diff --git a/Modules/clinic/unicodedata.c.h b/Modules/clinic/unicodedata.c.h index 1a6cd93daa3c9b..77e4f22593b017 100644 --- a/Modules/clinic/unicodedata.c.h +++ b/Modules/clinic/unicodedata.c.h @@ -30,14 +30,14 @@ unicodedata_UCD_decimal(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("decimal", 1, "argument 1", "a unicode character", args[0]); + _PyArg_BadArgument("decimal", "argument 1", "a unicode character", args[0]); goto exit; } if (PyUnicode_READY(args[0])) { goto exit; } if (PyUnicode_GET_LENGTH(args[0]) != 1) { - _PyArg_BadArgument("decimal", 1, "argument 1", "a unicode character", args[0]); + _PyArg_BadArgument("decimal", "argument 1", "a unicode character", args[0]); goto exit; } chr = PyUnicode_READ_CHAR(args[0], 0); @@ -79,14 +79,14 @@ unicodedata_UCD_digit(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("digit", 1, "argument 1", "a unicode character", args[0]); + _PyArg_BadArgument("digit", "argument 1", "a unicode character", args[0]); goto exit; } if (PyUnicode_READY(args[0])) { goto exit; } if (PyUnicode_GET_LENGTH(args[0]) != 1) { - _PyArg_BadArgument("digit", 1, "argument 1", "a unicode character", args[0]); + _PyArg_BadArgument("digit", "argument 1", "a unicode character", args[0]); goto exit; } chr = PyUnicode_READ_CHAR(args[0], 0); @@ -129,14 +129,14 @@ unicodedata_UCD_numeric(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("numeric", 1, "argument 1", "a unicode character", args[0]); + _PyArg_BadArgument("numeric", "argument 1", "a unicode character", args[0]); goto exit; } if (PyUnicode_READY(args[0])) { goto exit; } if (PyUnicode_GET_LENGTH(args[0]) != 1) { - _PyArg_BadArgument("numeric", 1, "argument 1", "a unicode character", args[0]); + _PyArg_BadArgument("numeric", "argument 1", "a unicode character", args[0]); goto exit; } chr = PyUnicode_READ_CHAR(args[0], 0); @@ -170,14 +170,14 @@ unicodedata_UCD_category(PyObject *self, PyObject *arg) int chr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("category", 0, "argument", "a unicode character", arg); + _PyArg_BadArgument("category", "argument", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("category", 0, "argument", "a unicode character", arg); + _PyArg_BadArgument("category", "argument", "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -208,14 +208,14 @@ unicodedata_UCD_bidirectional(PyObject *self, PyObject *arg) int chr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("bidirectional", 0, "argument", "a unicode character", arg); + _PyArg_BadArgument("bidirectional", "argument", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("bidirectional", 0, "argument", "a unicode character", arg); + _PyArg_BadArgument("bidirectional", "argument", "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -247,14 +247,14 @@ unicodedata_UCD_combining(PyObject *self, PyObject *arg) int _return_value; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("combining", 0, "argument", "a unicode character", arg); + _PyArg_BadArgument("combining", "argument", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("combining", 0, "argument", "a unicode character", arg); + _PyArg_BadArgument("combining", "argument", "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -291,14 +291,14 @@ unicodedata_UCD_mirrored(PyObject *self, PyObject *arg) int _return_value; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("mirrored", 0, "argument", "a unicode character", arg); + _PyArg_BadArgument("mirrored", "argument", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("mirrored", 0, "argument", "a unicode character", arg); + _PyArg_BadArgument("mirrored", "argument", "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -331,14 +331,14 @@ unicodedata_UCD_east_asian_width(PyObject *self, PyObject *arg) int chr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("east_asian_width", 0, "argument", "a unicode character", arg); + _PyArg_BadArgument("east_asian_width", "argument", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("east_asian_width", 0, "argument", "a unicode character", arg); + _PyArg_BadArgument("east_asian_width", "argument", "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -369,14 +369,14 @@ unicodedata_UCD_decomposition(PyObject *self, PyObject *arg) int chr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("decomposition", 0, "argument", "a unicode character", arg); + _PyArg_BadArgument("decomposition", "argument", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("decomposition", 0, "argument", "a unicode character", arg); + _PyArg_BadArgument("decomposition", "argument", "a unicode character", arg); goto exit; } chr = PyUnicode_READ_CHAR(arg, 0); @@ -412,7 +412,7 @@ unicodedata_UCD_is_normalized(PyObject *self, PyObject *const *args, Py_ssize_t goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("is_normalized", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("is_normalized", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -420,7 +420,7 @@ unicodedata_UCD_is_normalized(PyObject *self, PyObject *const *args, Py_ssize_t } form = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("is_normalized", 2, "argument 2", "str", args[1]); + _PyArg_BadArgument("is_normalized", "argument 2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -459,7 +459,7 @@ unicodedata_UCD_normalize(PyObject *self, PyObject *const *args, Py_ssize_t narg goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("normalize", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("normalize", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -467,7 +467,7 @@ unicodedata_UCD_normalize(PyObject *self, PyObject *const *args, Py_ssize_t narg } form = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("normalize", 2, "argument 2", "str", args[1]); + _PyArg_BadArgument("normalize", "argument 2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -506,14 +506,14 @@ unicodedata_UCD_name(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("name", 1, "argument 1", "a unicode character", args[0]); + _PyArg_BadArgument("name", "argument 1", "a unicode character", args[0]); goto exit; } if (PyUnicode_READY(args[0])) { goto exit; } if (PyUnicode_GET_LENGTH(args[0]) != 1) { - _PyArg_BadArgument("name", 1, "argument 1", "a unicode character", args[0]); + _PyArg_BadArgument("name", "argument 1", "a unicode character", args[0]); goto exit; } chr = PyUnicode_READ_CHAR(args[0], 0); @@ -559,4 +559,4 @@ unicodedata_UCD_lookup(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=7d09237084a0b1f2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3238f76814fb48d1 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/zlibmodule.c.h b/Modules/clinic/zlibmodule.c.h index 08c184f9579235..77ea04a353bf14 100644 --- a/Modules/clinic/zlibmodule.c.h +++ b/Modules/clinic/zlibmodule.c.h @@ -38,7 +38,7 @@ zlib_compress(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("compress", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("compress", "argument 1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -105,7 +105,7 @@ zlib_decompress(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("decompress", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("decompress", "argument 1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -273,7 +273,7 @@ zlib_compressobj(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb goto exit; } if (!PyBuffer_IsContiguous(&zdict, 'C')) { - _PyArg_BadArgument("compressobj", 6, "argument 'zdict'", "contiguous buffer", args[5]); + _PyArg_BadArgument("compressobj", "argument 'zdict'", "contiguous buffer", args[5]); goto exit; } skip_optional_pos: @@ -375,7 +375,7 @@ zlib_Compress_compress(compobject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("compress", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("compress", "argument", "contiguous buffer", arg); goto exit; } return_value = zlib_Compress_compress_impl(self, &data); @@ -432,7 +432,7 @@ zlib_Decompress_decompress(compobject *self, PyObject *const *args, Py_ssize_t n goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("decompress", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("decompress", "argument 1", "contiguous buffer", args[0]); goto exit; } if (!noptargs) { @@ -677,7 +677,7 @@ zlib_adler32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("adler32", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("adler32", "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -735,7 +735,7 @@ zlib_crc32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&data, 'C')) { - _PyArg_BadArgument("crc32", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("crc32", "argument 1", "contiguous buffer", args[0]); goto exit; } if (nargs < 2) { @@ -785,4 +785,4 @@ zlib_crc32(PyObject *module, PyObject *const *args, Py_ssize_t nargs) #ifndef ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF #define ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF #endif /* !defined(ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF) */ -/*[clinic end generated code: output=775a594fa952259e input=a9049054013a1b77]*/ +/*[clinic end generated code: output=faae38ef96b88b16 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/bytearrayobject.c.h b/Objects/clinic/bytearrayobject.c.h index c92912dd11fcc4..64ad6d12e42db8 100644 --- a/Objects/clinic/bytearrayobject.c.h +++ b/Objects/clinic/bytearrayobject.c.h @@ -115,14 +115,14 @@ bytearray_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&frm, 'C')) { - _PyArg_BadArgument("maketrans", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("maketrans", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &to, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&to, 'C')) { - _PyArg_BadArgument("maketrans", 2, "argument 2", "contiguous buffer", args[1]); + _PyArg_BadArgument("maketrans", "argument 2", "contiguous buffer", args[1]); goto exit; } return_value = bytearray_maketrans_impl(&frm, &to); @@ -175,14 +175,14 @@ bytearray_replace(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t nar goto exit; } if (!PyBuffer_IsContiguous(&old, 'C')) { - _PyArg_BadArgument("replace", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("replace", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &new, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&new, 'C')) { - _PyArg_BadArgument("replace", 2, "argument 2", "contiguous buffer", args[1]); + _PyArg_BadArgument("replace", "argument 2", "contiguous buffer", args[1]); goto exit; } if (nargs < 3) { @@ -735,7 +735,7 @@ bytearray_decode(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t narg } if (args[0]) { if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("decode", 1, "argument 'encoding'", "str", args[0]); + _PyArg_BadArgument("decode", "argument 'encoding'", "str", args[0]); goto exit; } Py_ssize_t encoding_length; @@ -752,7 +752,7 @@ bytearray_decode(PyByteArrayObject *self, PyObject *const *args, Py_ssize_t narg } } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("decode", 2, "argument 'errors'", "str", args[1]); + _PyArg_BadArgument("decode", "argument 'errors'", "str", args[1]); goto exit; } Py_ssize_t errors_length; @@ -854,7 +854,7 @@ bytearray_fromhex(PyTypeObject *type, PyObject *arg) PyObject *string; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("fromhex", 0, "argument", "str", arg); + _PyArg_BadArgument("fromhex", "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -942,4 +942,4 @@ bytearray_sizeof(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored)) { return bytearray_sizeof_impl(self); } -/*[clinic end generated code: output=dfa47342816053ca input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b5cb4771c310f2c8 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/bytesobject.c.h b/Objects/clinic/bytesobject.c.h index 1cb10ebed4c821..52cd3d83574a74 100644 --- a/Objects/clinic/bytesobject.c.h +++ b/Objects/clinic/bytesobject.c.h @@ -99,7 +99,7 @@ bytes_partition(PyBytesObject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&sep, 'C')) { - _PyArg_BadArgument("partition", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("partition", "argument", "contiguous buffer", arg); goto exit; } return_value = bytes_partition_impl(self, &sep); @@ -142,7 +142,7 @@ bytes_rpartition(PyBytesObject *self, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&sep, 'C')) { - _PyArg_BadArgument("rpartition", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("rpartition", "argument", "contiguous buffer", arg); goto exit; } return_value = bytes_rpartition_impl(self, &sep); @@ -420,14 +420,14 @@ bytes_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&frm, 'C')) { - _PyArg_BadArgument("maketrans", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("maketrans", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &to, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&to, 'C')) { - _PyArg_BadArgument("maketrans", 2, "argument 2", "contiguous buffer", args[1]); + _PyArg_BadArgument("maketrans", "argument 2", "contiguous buffer", args[1]); goto exit; } return_value = bytes_maketrans_impl(&frm, &to); @@ -480,14 +480,14 @@ bytes_replace(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyBuffer_IsContiguous(&old, 'C')) { - _PyArg_BadArgument("replace", 1, "argument 1", "contiguous buffer", args[0]); + _PyArg_BadArgument("replace", "argument 1", "contiguous buffer", args[0]); goto exit; } if (PyObject_GetBuffer(args[1], &new, PyBUF_SIMPLE) != 0) { goto exit; } if (!PyBuffer_IsContiguous(&new, 'C')) { - _PyArg_BadArgument("replace", 2, "argument 2", "contiguous buffer", args[1]); + _PyArg_BadArgument("replace", "argument 2", "contiguous buffer", args[1]); goto exit; } if (nargs < 3) { @@ -568,7 +568,7 @@ bytes_decode(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObj } if (args[0]) { if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("decode", 1, "argument 'encoding'", "str", args[0]); + _PyArg_BadArgument("decode", "argument 'encoding'", "str", args[0]); goto exit; } Py_ssize_t encoding_length; @@ -585,7 +585,7 @@ bytes_decode(PyBytesObject *self, PyObject *const *args, Py_ssize_t nargs, PyObj } } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("decode", 2, "argument 'errors'", "str", args[1]); + _PyArg_BadArgument("decode", "argument 'errors'", "str", args[1]); goto exit; } Py_ssize_t errors_length; @@ -674,7 +674,7 @@ bytes_fromhex(PyTypeObject *type, PyObject *arg) PyObject *string; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("fromhex", 0, "argument", "str", arg); + _PyArg_BadArgument("fromhex", "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -686,4 +686,4 @@ bytes_fromhex(PyTypeObject *type, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=f74ee04e5192e286 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=1758dce5abfc7282 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/codeobject.c.h b/Objects/clinic/codeobject.c.h index 2dc7ae2b319f58..6596de051cacb3 100644 --- a/Objects/clinic/codeobject.c.h +++ b/Objects/clinic/codeobject.c.h @@ -158,7 +158,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[7]) { if (!PyBytes_Check(args[7])) { - _PyArg_BadArgument("replace", 8, "argument 'co_code'", "bytes", args[7]); + _PyArg_BadArgument("replace", "argument 'co_code'", "bytes", args[7]); goto exit; } co_code = (PyBytesObject *)args[7]; @@ -168,7 +168,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[8]) { if (!PyTuple_Check(args[8])) { - _PyArg_BadArgument("replace", 9, "argument 'co_consts'", "tuple", args[8]); + _PyArg_BadArgument("replace", "argument 'co_consts'", "tuple", args[8]); goto exit; } co_consts = args[8]; @@ -178,7 +178,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[9]) { if (!PyTuple_Check(args[9])) { - _PyArg_BadArgument("replace", 10, "argument 'co_names'", "tuple", args[9]); + _PyArg_BadArgument("replace", "argument 'co_names'", "tuple", args[9]); goto exit; } co_names = args[9]; @@ -188,7 +188,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[10]) { if (!PyTuple_Check(args[10])) { - _PyArg_BadArgument("replace", 11, "argument 'co_varnames'", "tuple", args[10]); + _PyArg_BadArgument("replace", "argument 'co_varnames'", "tuple", args[10]); goto exit; } co_varnames = args[10]; @@ -198,7 +198,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[11]) { if (!PyTuple_Check(args[11])) { - _PyArg_BadArgument("replace", 12, "argument 'co_freevars'", "tuple", args[11]); + _PyArg_BadArgument("replace", "argument 'co_freevars'", "tuple", args[11]); goto exit; } co_freevars = args[11]; @@ -208,7 +208,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[12]) { if (!PyTuple_Check(args[12])) { - _PyArg_BadArgument("replace", 13, "argument 'co_cellvars'", "tuple", args[12]); + _PyArg_BadArgument("replace", "argument 'co_cellvars'", "tuple", args[12]); goto exit; } co_cellvars = args[12]; @@ -218,7 +218,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[13]) { if (!PyUnicode_Check(args[13])) { - _PyArg_BadArgument("replace", 14, "argument 'co_filename'", "str", args[13]); + _PyArg_BadArgument("replace", "argument 'co_filename'", "str", args[13]); goto exit; } if (PyUnicode_READY(args[13]) == -1) { @@ -231,7 +231,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } if (args[14]) { if (!PyUnicode_Check(args[14])) { - _PyArg_BadArgument("replace", 15, "argument 'co_name'", "str", args[14]); + _PyArg_BadArgument("replace", "argument 'co_name'", "str", args[14]); goto exit; } if (PyUnicode_READY(args[14]) == -1) { @@ -243,7 +243,7 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje } } if (!PyBytes_Check(args[15])) { - _PyArg_BadArgument("replace", 16, "argument 'co_lnotab'", "bytes", args[15]); + _PyArg_BadArgument("replace", "argument 'co_lnotab'", "bytes", args[15]); goto exit; } co_lnotab = (PyBytesObject *)args[15]; @@ -253,4 +253,4 @@ code_replace(PyCodeObject *self, PyObject *const *args, Py_ssize_t nargs, PyObje exit: return return_value; } -/*[clinic end generated code: output=b4b7c0d522e75335 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=fade581d6313a0c2 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/floatobject.c.h b/Objects/clinic/floatobject.c.h index 893f8d306c5442..6515d118e50693 100644 --- a/Objects/clinic/floatobject.c.h +++ b/Objects/clinic/floatobject.c.h @@ -235,7 +235,7 @@ float___getformat__(PyTypeObject *type, PyObject *arg) const char *typestr; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__getformat__", 0, "argument", "str", arg); + _PyArg_BadArgument("__getformat__", "argument", "str", arg); goto exit; } Py_ssize_t typestr_length; @@ -289,7 +289,7 @@ float___set_format__(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("__set_format__", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("__set_format__", "argument 1", "str", args[0]); goto exit; } Py_ssize_t typestr_length; @@ -302,7 +302,7 @@ float___set_format__(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs goto exit; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("__set_format__", 2, "argument 2", "str", args[1]); + _PyArg_BadArgument("__set_format__", "argument 2", "str", args[1]); goto exit; } Py_ssize_t fmt_length; @@ -339,7 +339,7 @@ float___format__(PyObject *self, PyObject *arg) PyObject *format_spec; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__format__", 0, "argument", "str", arg); + _PyArg_BadArgument("__format__", "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -351,4 +351,4 @@ float___format__(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=40b435f5108eb792 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=cc8098eb73f1a64c input=a9049054013a1b77]*/ diff --git a/Objects/clinic/funcobject.c.h b/Objects/clinic/funcobject.c.h index 0ea5e96e931651..17fb13fe085af3 100644 --- a/Objects/clinic/funcobject.c.h +++ b/Objects/clinic/funcobject.c.h @@ -44,12 +44,12 @@ func_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) goto exit; } if (!PyObject_TypeCheck(fastargs[0], &PyCode_Type)) { - _PyArg_BadArgument("function", 1, "argument 'code'", (&PyCode_Type)->tp_name, fastargs[0]); + _PyArg_BadArgument("function", "argument 'code'", (&PyCode_Type)->tp_name, fastargs[0]); goto exit; } code = (PyCodeObject *)fastargs[0]; if (!PyDict_Check(fastargs[1])) { - _PyArg_BadArgument("function", 2, "argument 'globals'", "dict", fastargs[1]); + _PyArg_BadArgument("function", "argument 'globals'", "dict", fastargs[1]); goto exit; } globals = fastargs[1]; @@ -75,4 +75,4 @@ func_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=3ce3d2c5cbfb7314 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3d96afa3396e5c82 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/longobject.c.h b/Objects/clinic/longobject.c.h index 59d5d30eeac19f..27e8dfe935b6e1 100644 --- a/Objects/clinic/longobject.c.h +++ b/Objects/clinic/longobject.c.h @@ -74,7 +74,7 @@ int___format__(PyObject *self, PyObject *arg) PyObject *format_spec; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__format__", 0, "argument", "str", arg); + _PyArg_BadArgument("__format__", "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -227,7 +227,7 @@ int_to_bytes(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject * length = ival; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("to_bytes", 2, "argument 'byteorder'", "str", args[1]); + _PyArg_BadArgument("to_bytes", "argument 'byteorder'", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -293,7 +293,7 @@ int_from_bytes(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs, PyOb } bytes_obj = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("from_bytes", 2, "argument 'byteorder'", "str", args[1]); + _PyArg_BadArgument("from_bytes", "argument 'byteorder'", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -313,4 +313,4 @@ int_from_bytes(PyTypeObject *type, PyObject *const *args, Py_ssize_t nargs, PyOb exit: return return_value; } -/*[clinic end generated code: output=05b782a0f235b5d2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=77bc3b2615822cb8 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/moduleobject.c.h b/Objects/clinic/moduleobject.c.h index ddc125ccabdb00..c1534eaee25886 100644 --- a/Objects/clinic/moduleobject.c.h +++ b/Objects/clinic/moduleobject.c.h @@ -31,7 +31,7 @@ module___init__(PyObject *self, PyObject *args, PyObject *kwargs) goto exit; } if (!PyUnicode_Check(fastargs[0])) { - _PyArg_BadArgument("module", 1, "argument 'name'", "str", fastargs[0]); + _PyArg_BadArgument("module", "argument 'name'", "str", fastargs[0]); goto exit; } if (PyUnicode_READY(fastargs[0]) == -1) { @@ -48,4 +48,4 @@ module___init__(PyObject *self, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=531c1d681a0ca036 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=680276bc3a496d7a input=a9049054013a1b77]*/ diff --git a/Objects/clinic/typeobject.c.h b/Objects/clinic/typeobject.c.h index 19bee130fdb93d..357eb44b12b8a1 100644 --- a/Objects/clinic/typeobject.c.h +++ b/Objects/clinic/typeobject.c.h @@ -200,7 +200,7 @@ object___format__(PyObject *self, PyObject *arg) PyObject *format_spec; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__format__", 0, "argument", "str", arg); + _PyArg_BadArgument("__format__", "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -248,4 +248,4 @@ object___dir__(PyObject *self, PyObject *Py_UNUSED(ignored)) { return object___dir___impl(self); } -/*[clinic end generated code: output=f6b2e2a0c71b5664 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7a6d272d282308f3 input=a9049054013a1b77]*/ diff --git a/Objects/clinic/unicodeobject.c.h b/Objects/clinic/unicodeobject.c.h index 2c4649b67c5d8b..cb350874dad185 100644 --- a/Objects/clinic/unicodeobject.c.h +++ b/Objects/clinic/unicodeobject.c.h @@ -157,7 +157,7 @@ unicode_encode(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject } if (args[0]) { if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("encode", 1, "argument 'encoding'", "str", args[0]); + _PyArg_BadArgument("encode", "argument 'encoding'", "str", args[0]); goto exit; } Py_ssize_t encoding_length; @@ -174,7 +174,7 @@ unicode_encode(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject } } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("encode", 2, "argument 'errors'", "str", args[1]); + _PyArg_BadArgument("encode", "argument 'errors'", "str", args[1]); goto exit; } Py_ssize_t errors_length; @@ -712,7 +712,7 @@ unicode_replace(PyObject *self, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyUnicode_Check(args[0])) { - _PyArg_BadArgument("replace", 1, "argument 1", "str", args[0]); + _PyArg_BadArgument("replace", "argument 1", "str", args[0]); goto exit; } if (PyUnicode_READY(args[0]) == -1) { @@ -720,7 +720,7 @@ unicode_replace(PyObject *self, PyObject *const *args, Py_ssize_t nargs) } old = args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("replace", 2, "argument 2", "str", args[1]); + _PyArg_BadArgument("replace", "argument 2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -1080,7 +1080,7 @@ unicode_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("maketrans", 2, "argument 2", "str", args[1]); + _PyArg_BadArgument("maketrans", "argument 2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -1091,7 +1091,7 @@ unicode_maketrans(void *null, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("maketrans", 3, "argument 3", "str", args[2]); + _PyArg_BadArgument("maketrans", "argument 3", "str", args[2]); goto exit; } if (PyUnicode_READY(args[2]) == -1) { @@ -1202,7 +1202,7 @@ unicode___format__(PyObject *self, PyObject *arg) PyObject *format_spec; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("__format__", 0, "argument", "str", arg); + _PyArg_BadArgument("__format__", "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -1232,4 +1232,4 @@ unicode_sizeof(PyObject *self, PyObject *Py_UNUSED(ignored)) { return unicode_sizeof_impl(self); } -/*[clinic end generated code: output=ac54f48ebafcf526 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=d9a6ee45ddd0ccfd input=a9049054013a1b77]*/ diff --git a/Objects/stringlib/clinic/transmogrify.h.h b/Objects/stringlib/clinic/transmogrify.h.h index f903ec239d74cc..8a3a060f12bc9e 100644 --- a/Objects/stringlib/clinic/transmogrify.h.h +++ b/Objects/stringlib/clinic/transmogrify.h.h @@ -100,7 +100,7 @@ stringlib_ljust(PyObject *self, PyObject *const *args, Py_ssize_t nargs) fillchar = PyByteArray_AS_STRING(args[1])[0]; } else { - _PyArg_BadArgument("ljust", 2, "argument 2", "a byte string of length 1", args[1]); + _PyArg_BadArgument("ljust", "argument 2", "a byte string of length 1", args[1]); goto exit; } skip_optional: @@ -161,7 +161,7 @@ stringlib_rjust(PyObject *self, PyObject *const *args, Py_ssize_t nargs) fillchar = PyByteArray_AS_STRING(args[1])[0]; } else { - _PyArg_BadArgument("rjust", 2, "argument 2", "a byte string of length 1", args[1]); + _PyArg_BadArgument("rjust", "argument 2", "a byte string of length 1", args[1]); goto exit; } skip_optional: @@ -222,7 +222,7 @@ stringlib_center(PyObject *self, PyObject *const *args, Py_ssize_t nargs) fillchar = PyByteArray_AS_STRING(args[1])[0]; } else { - _PyArg_BadArgument("center", 2, "argument 2", "a byte string of length 1", args[1]); + _PyArg_BadArgument("center", "argument 2", "a byte string of length 1", args[1]); goto exit; } skip_optional: @@ -274,4 +274,4 @@ stringlib_zfill(PyObject *self, PyObject *arg) exit: return return_value; } -/*[clinic end generated code: output=12ba03626b7614b2 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=15be047aef999b4e input=a9049054013a1b77]*/ diff --git a/PC/clinic/_testconsole.c.h b/PC/clinic/_testconsole.c.h index 3dad7b39b14a9e..cf5e4ee09063aa 100644 --- a/PC/clinic/_testconsole.c.h +++ b/PC/clinic/_testconsole.c.h @@ -33,7 +33,7 @@ _testconsole_write_input(PyObject *module, PyObject *const *args, Py_ssize_t nar } file = args[0]; if (!PyBytes_Check(args[1])) { - _PyArg_BadArgument("write_input", 2, "argument 's'", "bytes", args[1]); + _PyArg_BadArgument("write_input", "argument 's'", "bytes", args[1]); goto exit; } s = (PyBytesObject *)args[1]; @@ -88,4 +88,4 @@ _testconsole_read_output(PyObject *module, PyObject *const *args, Py_ssize_t nar #ifndef _TESTCONSOLE_READ_OUTPUT_METHODDEF #define _TESTCONSOLE_READ_OUTPUT_METHODDEF #endif /* !defined(_TESTCONSOLE_READ_OUTPUT_METHODDEF) */ -/*[clinic end generated code: output=4e9531cf03b5c7ae input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dd8b093a91b62753 input=a9049054013a1b77]*/ diff --git a/PC/clinic/msvcrtmodule.c.h b/PC/clinic/msvcrtmodule.c.h index ffe9090a69c42a..180c3e5fc54a7a 100644 --- a/PC/clinic/msvcrtmodule.c.h +++ b/PC/clinic/msvcrtmodule.c.h @@ -375,7 +375,7 @@ msvcrt_putch(PyObject *module, PyObject *arg) char_value = PyByteArray_AS_STRING(arg)[0]; } else { - _PyArg_BadArgument("putch", 0, "argument", "a byte string of length 1", arg); + _PyArg_BadArgument("putch", "argument", "a byte string of length 1", arg); goto exit; } return_value = msvcrt_putch_impl(module, char_value); @@ -403,14 +403,14 @@ msvcrt_putwch(PyObject *module, PyObject *arg) int unicode_char; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("putwch", 0, "argument", "a unicode character", arg); + _PyArg_BadArgument("putwch", "argument", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("putwch", 0, "argument", "a unicode character", arg); + _PyArg_BadArgument("putwch", "argument", "a unicode character", arg); goto exit; } unicode_char = PyUnicode_READ_CHAR(arg, 0); @@ -449,7 +449,7 @@ msvcrt_ungetch(PyObject *module, PyObject *arg) char_value = PyByteArray_AS_STRING(arg)[0]; } else { - _PyArg_BadArgument("ungetch", 0, "argument", "a byte string of length 1", arg); + _PyArg_BadArgument("ungetch", "argument", "a byte string of length 1", arg); goto exit; } return_value = msvcrt_ungetch_impl(module, char_value); @@ -477,14 +477,14 @@ msvcrt_ungetwch(PyObject *module, PyObject *arg) int unicode_char; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("ungetwch", 0, "argument", "a unicode character", arg); + _PyArg_BadArgument("ungetwch", "argument", "a unicode character", arg); goto exit; } if (PyUnicode_READY(arg)) { goto exit; } if (PyUnicode_GET_LENGTH(arg) != 1) { - _PyArg_BadArgument("ungetwch", 0, "argument", "a unicode character", arg); + _PyArg_BadArgument("ungetwch", "argument", "a unicode character", arg); goto exit; } unicode_char = PyUnicode_READ_CHAR(arg, 0); @@ -679,4 +679,4 @@ msvcrt_SetErrorMode(PyObject *module, PyObject *arg) #ifndef MSVCRT_SET_ERROR_MODE_METHODDEF #define MSVCRT_SET_ERROR_MODE_METHODDEF #endif /* !defined(MSVCRT_SET_ERROR_MODE_METHODDEF) */ -/*[clinic end generated code: output=7c498a598dc9a5a5 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=7cc6ffaf64f268f7 input=a9049054013a1b77]*/ diff --git a/Python/clinic/bltinmodule.c.h b/Python/clinic/bltinmodule.c.h index 6ef30b0739f1ba..deecf29ebcff11 100644 --- a/Python/clinic/bltinmodule.c.h +++ b/Python/clinic/bltinmodule.c.h @@ -102,7 +102,7 @@ builtin_format(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto skip_optional; } if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("format", 2, "argument 2", "str", args[1]); + _PyArg_BadArgument("format", "argument 2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -200,7 +200,7 @@ builtin_compile(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObj goto exit; } if (!PyUnicode_Check(args[2])) { - _PyArg_BadArgument("compile", 3, "argument 'mode'", "str", args[2]); + _PyArg_BadArgument("compile", "argument 'mode'", "str", args[2]); goto exit; } Py_ssize_t mode_length; @@ -845,4 +845,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs) exit: return return_value; } -/*[clinic end generated code: output=cdfc262b33cfbb30 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=662a403184ac8328 input=a9049054013a1b77]*/ diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h index 36d206328cd62c..743d00222914e3 100644 --- a/Python/clinic/import.c.h +++ b/Python/clinic/import.c.h @@ -92,12 +92,12 @@ _imp__fix_co_filename(PyObject *module, PyObject *const *args, Py_ssize_t nargs) goto exit; } if (!PyObject_TypeCheck(args[0], &PyCode_Type)) { - _PyArg_BadArgument("_fix_co_filename", 1, "argument 1", (&PyCode_Type)->tp_name, args[0]); + _PyArg_BadArgument("_fix_co_filename", "argument 1", (&PyCode_Type)->tp_name, args[0]); goto exit; } code = (PyCodeObject *)args[0]; if (!PyUnicode_Check(args[1])) { - _PyArg_BadArgument("_fix_co_filename", 2, "argument 2", "str", args[1]); + _PyArg_BadArgument("_fix_co_filename", "argument 2", "str", args[1]); goto exit; } if (PyUnicode_READY(args[1]) == -1) { @@ -156,7 +156,7 @@ _imp_init_frozen(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("init_frozen", 0, "argument", "str", arg); + _PyArg_BadArgument("init_frozen", "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -188,7 +188,7 @@ _imp_get_frozen_object(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("get_frozen_object", 0, "argument", "str", arg); + _PyArg_BadArgument("get_frozen_object", "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -220,7 +220,7 @@ _imp_is_frozen_package(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("is_frozen_package", 0, "argument", "str", arg); + _PyArg_BadArgument("is_frozen_package", "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -252,7 +252,7 @@ _imp_is_builtin(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("is_builtin", 0, "argument", "str", arg); + _PyArg_BadArgument("is_builtin", "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -284,7 +284,7 @@ _imp_is_frozen(PyObject *module, PyObject *arg) PyObject *name; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("is_frozen", 0, "argument", "str", arg); + _PyArg_BadArgument("is_frozen", "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -433,7 +433,7 @@ _imp_source_hash(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb goto exit; } if (!PyBuffer_IsContiguous(&source, 'C')) { - _PyArg_BadArgument("source_hash", 2, "argument 'source'", "contiguous buffer", args[1]); + _PyArg_BadArgument("source_hash", "argument 'source'", "contiguous buffer", args[1]); goto exit; } return_value = _imp_source_hash_impl(module, key, &source); @@ -454,4 +454,4 @@ _imp_source_hash(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyOb #ifndef _IMP_EXEC_DYNAMIC_METHODDEF #define _IMP_EXEC_DYNAMIC_METHODDEF #endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */ -/*[clinic end generated code: output=0ecaa2acf655f438 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ff06f7cf4b73eb76 input=a9049054013a1b77]*/ diff --git a/Python/clinic/marshal.c.h b/Python/clinic/marshal.c.h index 19f4a4e18d0ed7..05d4830c4ab313 100644 --- a/Python/clinic/marshal.c.h +++ b/Python/clinic/marshal.c.h @@ -152,7 +152,7 @@ marshal_loads(PyObject *module, PyObject *arg) goto exit; } if (!PyBuffer_IsContiguous(&bytes, 'C')) { - _PyArg_BadArgument("loads", 0, "argument", "contiguous buffer", arg); + _PyArg_BadArgument("loads", "argument", "contiguous buffer", arg); goto exit; } return_value = marshal_loads_impl(module, &bytes); @@ -165,4 +165,4 @@ marshal_loads(PyObject *module, PyObject *arg) return return_value; } -/*[clinic end generated code: output=6ccb3aceb30ac9b0 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=a859dabe8b0afeb6 input=a9049054013a1b77]*/ diff --git a/Python/clinic/sysmodule.c.h b/Python/clinic/sysmodule.c.h index c37ed666ae8843..13f9374160c9cc 100644 --- a/Python/clinic/sysmodule.c.h +++ b/Python/clinic/sysmodule.c.h @@ -228,7 +228,7 @@ sys_intern(PyObject *module, PyObject *arg) PyObject *s; if (!PyUnicode_Check(arg)) { - _PyArg_BadArgument("intern", 0, "argument", "str", arg); + _PyArg_BadArgument("intern", "argument", "str", arg); goto exit; } if (PyUnicode_READY(arg) == -1) { @@ -925,7 +925,7 @@ sys_call_tracing(PyObject *module, PyObject *const *args, Py_ssize_t nargs) } func = args[0]; if (!PyTuple_Check(args[1])) { - _PyArg_BadArgument("call_tracing", 2, "argument 2", "tuple", args[1]); + _PyArg_BadArgument("call_tracing", "argument 2", "tuple", args[1]); goto exit; } funcargs = args[1]; @@ -1082,4 +1082,4 @@ sys_getandroidapilevel(PyObject *module, PyObject *Py_UNUSED(ignored)) #ifndef SYS_GETANDROIDAPILEVEL_METHODDEF #define SYS_GETANDROIDAPILEVEL_METHODDEF #endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */ -/*[clinic end generated code: output=01592ef076925d6f input=a9049054013a1b77]*/ +/*[clinic end generated code: output=b8fc76b2c5228aa7 input=a9049054013a1b77]*/ diff --git a/Python/clinic/traceback.c.h b/Python/clinic/traceback.c.h index 427513cf0ee09e..04daf2a3766988 100644 --- a/Python/clinic/traceback.c.h +++ b/Python/clinic/traceback.c.h @@ -32,7 +32,7 @@ tb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) } tb_next = fastargs[0]; if (!PyObject_TypeCheck(fastargs[1], &PyFrame_Type)) { - _PyArg_BadArgument("TracebackType", 2, "argument 'tb_frame'", (&PyFrame_Type)->tp_name, fastargs[1]); + _PyArg_BadArgument("TracebackType", "argument 'tb_frame'", (&PyFrame_Type)->tp_name, fastargs[1]); goto exit; } tb_frame = (PyFrameObject *)fastargs[1]; @@ -59,4 +59,4 @@ tb_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) exit: return return_value; } -/*[clinic end generated code: output=4574241b9fd9494c input=a9049054013a1b77]*/ +/*[clinic end generated code: output=3def6c06248feed8 input=a9049054013a1b77]*/ diff --git a/Python/getargs.c b/Python/getargs.c index 3e1547754975c1..f41eeae0e51478 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -615,7 +615,7 @@ convertitem(PyObject *arg, const char **p_format, va_list *p_va, int flags, */ void -_PyArg_BadArgument(const char *fname, int iarg, const char *displayname, +_PyArg_BadArgument(const char *fname, const char *displayname, const char *expected, PyObject *arg) { PyErr_Format(PyExc_TypeError, diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index cf7b14e1b5a4f5..051b87b454d4ae 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -807,7 +807,7 @@ def parser_body(prototype, *fields, declarations=''): """ % argname) displayname = parameters[0].get_displayname(0) - parsearg = converters[0].parse_arg(argname, 0, displayname) + parsearg = converters[0].parse_arg(argname, displayname) if parsearg is None: parsearg = """ if (!PyArg_Parse(%s, "{format_units}:{name}", {parse_arguments})) {{ @@ -853,7 +853,7 @@ def parser_body(prototype, *fields, declarations=''): has_optional = False for i, p in enumerate(parameters): displayname = p.get_displayname(i+1) - parsearg = p.converter.parse_arg(argname_fmt % i, i + 1, displayname) + parsearg = p.converter.parse_arg(argname_fmt % i, displayname) if parsearg is None: #print('Cannot convert %s %r for %s' % (p.converter.__class__.__name__, p.converter.format_unit, p.converter.name), file=sys.stderr) parser_code = None @@ -930,7 +930,7 @@ def parser_body(prototype, *fields, declarations=''): add_label = None for i, p in enumerate(parameters): displayname = p.get_displayname(i+1) - parsearg = p.converter.parse_arg(argname_fmt % i, i + 1, displayname) + parsearg = p.converter.parse_arg(argname_fmt % i, displayname) if parsearg is None: #print('Cannot convert %s %r for %s' % (p.converter.__class__.__name__, p.converter.format_unit, p.converter.name), file=sys.stderr) parser_code = None @@ -2650,7 +2650,7 @@ def pre_render(self): """ pass - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'O&': return """ if (!{converter}({argname}, &{paramname})) {{{{ @@ -2664,20 +2664,20 @@ def parse_arg(self, argname, argnum, displayname): typecheck, typename = type_checks[self.subclass_of] return """ if (!{typecheck}({argname})) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "{typename}", {argname}); + _PyArg_BadArgument("{{name}}", {displayname}, "{typename}", {argname}); goto exit; }}}} {paramname} = {cast}{argname}; """.format(argname=argname, paramname=self.name, - argnum=argnum, displayname=displayname, - typecheck=typecheck, typename=typename, cast=cast) + displayname=displayname, typecheck=typecheck, + typename=typename, cast=cast) return """ if (!PyObject_TypeCheck({argname}, {subclass_of})) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, ({subclass_of})->tp_name, {argname}); + _PyArg_BadArgument("{{name}}", {displayname}, ({subclass_of})->tp_name, {argname}); goto exit; }}}} {paramname} = {cast}{argname}; - """.format(argname=argname, paramname=self.name, argnum=argnum, + """.format(argname=argname, paramname=self.name, subclass_of=self.subclass_of, cast=cast, displayname=displayname) if self.format_unit == 'O': @@ -2715,7 +2715,7 @@ def converter_init(self, *, accept={object}): self.default = bool(self.default) self.c_default = str(int(self.default)) - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'i': # XXX PyFloat_Check can be removed after the end of the # deprecation in _PyLong_FromNbIndexOrNbInt. @@ -2737,7 +2737,7 @@ def parse_arg(self, argname, argnum, displayname): goto exit; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) class char_converter(CConverter): type = 'char' @@ -2754,7 +2754,7 @@ def converter_init(self): if self.c_default == '"\'"': self.c_default = r"'\''" - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'c': return """ if (PyBytes_Check({argname}) && PyBytes_GET_SIZE({argname}) == 1) {{{{ @@ -2764,12 +2764,12 @@ def parse_arg(self, argname, argnum, displayname): {paramname} = PyByteArray_AS_STRING({argname})[0]; }}}} else {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "a byte string of length 1", {argname}); + _PyArg_BadArgument("{{name}}", {displayname}, "a byte string of length 1", {argname}); goto exit; }}}} - """.format(argname=argname, paramname=self.name, argnum=argnum, + """.format(argname=argname, paramname=self.name, displayname=displayname) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) @add_legacy_c_converter('B', bitwise=True) @@ -2783,7 +2783,7 @@ def converter_init(self, *, bitwise=False): if bitwise: self.format_unit = 'B' - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'b': return """ if (PyFloat_Check({argname})) {{{{ @@ -2828,7 +2828,7 @@ def parse_arg(self, argname, argnum, displayname): }}}} }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) class byte_converter(unsigned_char_converter): pass @@ -2838,7 +2838,7 @@ class short_converter(CConverter): format_unit = 'h' c_ignored_default = "0" - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'h': return """ if (PyFloat_Check({argname})) {{{{ @@ -2866,7 +2866,7 @@ def parse_arg(self, argname, argnum, displayname): }}}} }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) class unsigned_short_converter(CConverter): type = 'unsigned short' @@ -2879,7 +2879,7 @@ def converter_init(self, *, bitwise=False): else: self.converter = '_PyLong_UnsignedShort_Converter' - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'H': return """ if (PyFloat_Check({argname})) {{{{ @@ -2892,7 +2892,7 @@ def parse_arg(self, argname, argnum, displayname): goto exit; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) @add_legacy_c_converter('C', accept={str}) class int_converter(CConverter): @@ -2909,7 +2909,7 @@ def converter_init(self, *, accept={int}, type=None): if type != None: self.type = type - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'i': return """ if (PyFloat_Check({argname})) {{{{ @@ -2925,20 +2925,20 @@ def parse_arg(self, argname, argnum, displayname): elif self.format_unit == 'C': return """ if (!PyUnicode_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "a unicode character", {argname}); + _PyArg_BadArgument("{{name}}", {displayname}, "a unicode character", {argname}); goto exit; }}}} if (PyUnicode_READY({argname})) {{{{ goto exit; }}}} if (PyUnicode_GET_LENGTH({argname}) != 1) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "a unicode character", {argname}); + _PyArg_BadArgument("{{name}}", {displayname}, "a unicode character", {argname}); goto exit; }}}} {paramname} = PyUnicode_READ_CHAR({argname}, 0); - """.format(argname=argname, paramname=self.name, argnum=argnum, + """.format(argname=argname, paramname=self.name, displayname=displayname) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) class unsigned_int_converter(CConverter): type = 'unsigned int' @@ -2951,7 +2951,7 @@ def converter_init(self, *, bitwise=False): else: self.converter = '_PyLong_UnsignedInt_Converter' - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'I': return """ if (PyFloat_Check({argname})) {{{{ @@ -2964,7 +2964,7 @@ def parse_arg(self, argname, argnum, displayname): goto exit; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) class long_converter(CConverter): type = 'long' @@ -2972,7 +2972,7 @@ class long_converter(CConverter): format_unit = 'l' c_ignored_default = "0" - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'l': return """ if (PyFloat_Check({argname})) {{{{ @@ -2985,7 +2985,7 @@ def parse_arg(self, argname, argnum, displayname): goto exit; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) class unsigned_long_converter(CConverter): type = 'unsigned long' @@ -2998,17 +2998,17 @@ def converter_init(self, *, bitwise=False): else: self.converter = '_PyLong_UnsignedLong_Converter' - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'k': return """ if (!PyLong_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "int", {argname}); + _PyArg_BadArgument("{{name}}", {displayname}, "int", {argname}); goto exit; }}}} {paramname} = PyLong_AsUnsignedLongMask({argname}); - """.format(argname=argname, paramname=self.name, argnum=argnum, + """.format(argname=argname, paramname=self.name, displayname=displayname) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) class long_long_converter(CConverter): type = 'long long' @@ -3016,7 +3016,7 @@ class long_long_converter(CConverter): format_unit = 'L' c_ignored_default = "0" - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'L': return """ if (PyFloat_Check({argname})) {{{{ @@ -3029,7 +3029,7 @@ def parse_arg(self, argname, argnum, displayname): goto exit; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) class unsigned_long_long_converter(CConverter): type = 'unsigned long long' @@ -3042,17 +3042,17 @@ def converter_init(self, *, bitwise=False): else: self.converter = '_PyLong_UnsignedLongLong_Converter' - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'K': return """ if (!PyLong_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "int", {argname}); + _PyArg_BadArgument("{{name}}", {displayname}, "int", {argname}); goto exit; }}}} {paramname} = PyLong_AsUnsignedLongLongMask({argname}); - """.format(argname=argname, paramname=self.name, argnum=argnum, + """.format(argname=argname, paramname=self.name, displayname=displayname) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) class Py_ssize_t_converter(CConverter): type = 'Py_ssize_t' @@ -3067,7 +3067,7 @@ def converter_init(self, *, accept={int}): else: fail("Py_ssize_t_converter: illegal 'accept' argument " + repr(accept)) - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'n': return """ if (PyFloat_Check({argname})) {{{{ @@ -3088,7 +3088,7 @@ def parse_arg(self, argname, argnum, displayname): {paramname} = ival; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) class slice_index_converter(CConverter): @@ -3107,7 +3107,7 @@ class size_t_converter(CConverter): converter = '_PyLong_Size_t_Converter' c_ignored_default = "0" - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'n': return """ {paramname} = PyNumber_AsSsize_t({argname}, PyExc_OverflowError); @@ -3115,7 +3115,7 @@ def parse_arg(self, argname, argnum, displayname): goto exit; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) class float_converter(CConverter): @@ -3124,7 +3124,7 @@ class float_converter(CConverter): format_unit = 'f' c_ignored_default = "0.0" - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'f': return """ {paramname} = (float) PyFloat_AsDouble({argname}); @@ -3132,7 +3132,7 @@ def parse_arg(self, argname, argnum, displayname): goto exit; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) class double_converter(CConverter): type = 'double' @@ -3140,7 +3140,7 @@ class double_converter(CConverter): format_unit = 'd' c_ignored_default = "0.0" - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'd': return """ {paramname} = PyFloat_AsDouble({argname}); @@ -3148,7 +3148,7 @@ def parse_arg(self, argname, argnum, displayname): goto exit; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) class Py_complex_converter(CConverter): @@ -3157,7 +3157,7 @@ class Py_complex_converter(CConverter): format_unit = 'D' c_ignored_default = "{0.0, 0.0}" - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'D': return """ {paramname} = PyComplex_AsCComplex({argname}); @@ -3165,7 +3165,7 @@ def parse_arg(self, argname, argnum, displayname): goto exit; }}}} """.format(argname=argname, paramname=self.name) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) class object_converter(CConverter): @@ -3231,11 +3231,11 @@ def cleanup(self): name = self.name return "".join(["if (", name, ") {\n PyMem_FREE(", name, ");\n}\n"]) - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 's': return """ if (!PyUnicode_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "str", {argname}); + _PyArg_BadArgument("{{name}}", {displayname}, "str", {argname}); goto exit; }}}} Py_ssize_t {paramname}_length; @@ -3247,7 +3247,7 @@ def parse_arg(self, argname, argnum, displayname): PyErr_SetString(PyExc_ValueError, "embedded null character"); goto exit; }}}} - """.format(argname=argname, paramname=self.name, argnum=argnum, + """.format(argname=argname, paramname=self.name, displayname=displayname) if self.format_unit == 'z': return """ @@ -3266,12 +3266,12 @@ def parse_arg(self, argname, argnum, displayname): }}}} }}}} else {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "str or None", {argname}); + _PyArg_BadArgument("{{name}}", {displayname}, "str or None", {argname}); goto exit; }}}} - """.format(argname=argname, paramname=self.name, argnum=argnum, + """.format(argname=argname, paramname=self.name, displayname=displayname) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) # # This is the fourth or fifth rewrite of registering all the @@ -3326,54 +3326,54 @@ class PyBytesObject_converter(CConverter): format_unit = 'S' # accept = {bytes} - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'S': return """ if (!PyBytes_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "bytes", {argname}); + _PyArg_BadArgument("{{name}}", {displayname}, "bytes", {argname}); goto exit; }}}} {paramname} = ({type}){argname}; - """.format(argname=argname, paramname=self.name, argnum=argnum, + """.format(argname=argname, paramname=self.name, type=self.type, displayname=displayname) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) class PyByteArrayObject_converter(CConverter): type = 'PyByteArrayObject *' format_unit = 'Y' # accept = {bytearray} - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'Y': return """ if (!PyByteArray_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "bytearray", {argname}); + _PyArg_BadArgument("{{name}}", {displayname}, "bytearray", {argname}); goto exit; }}}} {paramname} = ({type}){argname}; - """.format(argname=argname, paramname=self.name, argnum=argnum, + """.format(argname=argname, paramname=self.name, type=self.type, displayname=displayname) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) class unicode_converter(CConverter): type = 'PyObject *' default_type = (str, Null, NoneType) format_unit = 'U' - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'U': return """ if (!PyUnicode_Check({argname})) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "str", {argname}); + _PyArg_BadArgument("{{name}}", {displayname}, "str", {argname}); goto exit; }}}} if (PyUnicode_READY({argname}) == -1) {{{{ goto exit; }}}} {paramname} = {argname}; - """.format(argname=argname, paramname=self.name, argnum=argnum, + """.format(argname=argname, paramname=self.name, displayname=displayname) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) @add_legacy_c_converter('u#', zeroes=True) @add_legacy_c_converter('Z', accept={str, NoneType}) @@ -3422,17 +3422,17 @@ def cleanup(self): name = self.name return "".join(["if (", name, ".obj) {\n PyBuffer_Release(&", name, ");\n}\n"]) - def parse_arg(self, argname, argnum, displayname): + def parse_arg(self, argname, displayname): if self.format_unit == 'y*': return """ if (PyObject_GetBuffer({argname}, &{paramname}, PyBUF_SIMPLE) != 0) {{{{ goto exit; }}}} if (!PyBuffer_IsContiguous(&{paramname}, 'C')) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "contiguous buffer", {argname}); + _PyArg_BadArgument("{{name}}", {displayname}, "contiguous buffer", {argname}); goto exit; }}}} - """.format(argname=argname, paramname=self.name, argnum=argnum, + """.format(argname=argname, paramname=self.name, displayname=displayname) elif self.format_unit == 's*': return """ @@ -3449,26 +3449,26 @@ def parse_arg(self, argname, argnum, displayname): goto exit; }}}} if (!PyBuffer_IsContiguous(&{paramname}, 'C')) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "contiguous buffer", {argname}); + _PyArg_BadArgument("{{name}}", {displayname}, "contiguous buffer", {argname}); goto exit; }}}} }}}} - """.format(argname=argname, paramname=self.name, argnum=argnum, + """.format(argname=argname, paramname=self.name, displayname=displayname) elif self.format_unit == 'w*': return """ if (PyObject_GetBuffer({argname}, &{paramname}, PyBUF_WRITABLE) < 0) {{{{ PyErr_Clear(); - _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "read-write bytes-like object", {argname}); + _PyArg_BadArgument("{{name}}", {displayname}, "read-write bytes-like object", {argname}); goto exit; }}}} if (!PyBuffer_IsContiguous(&{paramname}, 'C')) {{{{ - _PyArg_BadArgument("{{name}}", {argnum}, {displayname}, "contiguous buffer", {argname}); + _PyArg_BadArgument("{{name}}", {displayname}, "contiguous buffer", {argname}); goto exit; }}}} - """.format(argname=argname, paramname=self.name, argnum=argnum, + """.format(argname=argname, paramname=self.name, displayname=displayname) - return super().parse_arg(argname, argnum, displayname) + return super().parse_arg(argname, displayname) def correct_name_for_self(f): From 9c674d769ef0f6a8e8b14297db42cf843927d036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Lapeyre?= Date: Thu, 29 Aug 2019 15:32:07 +0200 Subject: [PATCH 14/15] Fix typo in comment --- Python/getargs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/getargs.c b/Python/getargs.c index f41eeae0e51478..41fb4361ba12bf 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -611,7 +611,7 @@ convertitem(PyObject *arg, const char **p_format, va_list *p_va, int flags, /* Format an error message generated by convertsimple(). - displayname must be UTF-8 encodeded. + displayname must be UTF-8 encoded. */ void From 3dfcacf5ab381ab70c57d2968ed9706016b3ddb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Lapeyre?= Date: Thu, 29 Aug 2019 15:45:59 +0200 Subject: [PATCH 15/15] Remove is_positional_or_keyword --- Tools/clinic/clinic.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 1e0799fe6aba5b..58b8c033e78f1c 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -2268,12 +2268,6 @@ def __init__(self, name, kind, *, default=_empty, def __repr__(self): return '' - def is_positional_or_keyword(self): - return self.kind in ( - inspect.Parameter.POSITIONAL_OR_KEYWORD, - inspect.Parameter.KEYWORD_ONLY - ) - def is_keyword_only(self): return self.kind == inspect.Parameter.KEYWORD_ONLY @@ -2299,7 +2293,7 @@ def copy(self, **overrides): def get_displayname(self, i): if i == 0: return '"argument"' - if self.is_positional_or_keyword(): + if not self.is_positional_only(): return '''"argument '{}'"'''.format(self.name) else: return '"argument {}"'.format(i)