Index: Python/errors.c =================================================================== --- Python/errors.c (révision 81589) +++ Python/errors.c (copie de travail) @@ -679,7 +679,7 @@ goto failure; } /* Create a real new-style class. */ - result = PyObject_CallFunction((PyObject *)&PyType_Type, "UOO", + result = PyObject_CallFunction((PyObject *)&PyType_Type, "sOO", dot+1, bases, dict); failure: Py_XDECREF(bases); Index: Python/Python-ast.c =================================================================== --- Python/Python-ast.c (révision 81589) +++ Python/Python-ast.c (copie de travail) @@ -527,7 +527,7 @@ } PyTuple_SET_ITEM(fnames, i, field); } - result = PyObject_CallFunction((PyObject*)&PyType_Type, "U(O){sOss}", + result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){sOss}", type, base, "_fields", fnames, "__module__", "_ast"); Py_DECREF(fnames); return (PyTypeObject*)result; Index: Python/modsupport.c =================================================================== --- Python/modsupport.c (révision 81589) +++ Python/modsupport.c (copie de travail) @@ -302,6 +302,7 @@ case 's': case 'z': + case 'U': /* XXX deprecated alias */ { PyObject *v; char *str = va_arg(*p_va, char *); @@ -334,39 +335,6 @@ return v; } - case 'U': - { - PyObject *v; - char *str = va_arg(*p_va, char *); - Py_ssize_t n; - if (**p_format == '#') { - ++*p_format; - if (flags & FLAG_SIZE_T) - n = va_arg(*p_va, Py_ssize_t); - else - n = va_arg(*p_va, int); - } - else - n = -1; - if (str == NULL) { - v = Py_None; - Py_INCREF(v); - } - else { - if (n < 0) { - size_t m = strlen(str); - if (m > PY_SSIZE_T_MAX) { - PyErr_SetString(PyExc_OverflowError, - "string too long for Python string"); - return NULL; - } - n = (Py_ssize_t)m; - } - v = PyUnicode_FromStringAndSize(str, n); - } - return v; - } - case 'y': { PyObject *v; Index: Python/sysmodule.c =================================================================== --- Python/sysmodule.c (révision 81589) +++ Python/sysmodule.c (copie de travail) @@ -1510,7 +1510,7 @@ PyLong_FromLong(PY_VERSION_HEX)); svnversion_init(); SET_SYS_FROM_STRING("subversion", - Py_BuildValue("(UUU)", "CPython", branch, + Py_BuildValue("(sss)", "CPython", branch, svn_revision)); SET_SYS_FROM_STRING("dont_write_bytecode", PyBool_FromLong(Py_DontWriteBytecodeFlag)); Index: Objects/exceptions.c =================================================================== --- Objects/exceptions.c (révision 81589) +++ Objects/exceptions.c (copie de travail) @@ -1510,7 +1510,7 @@ const char *encoding, const Py_UNICODE *object, Py_ssize_t length, Py_ssize_t start, Py_ssize_t end, const char *reason) { - return PyObject_CallFunction(PyExc_UnicodeEncodeError, "Uu#nnU", + return PyObject_CallFunction(PyExc_UnicodeEncodeError, "su#nns", encoding, object, length, start, end, reason); } @@ -1625,7 +1625,7 @@ assert(length < INT_MAX); assert(start < INT_MAX); assert(end < INT_MAX); - return PyObject_CallFunction(PyExc_UnicodeDecodeError, "Uy#nnU", + return PyObject_CallFunction(PyExc_UnicodeDecodeError, "sy#nns", encoding, object, length, start, end, reason); } Index: Doc/c-api/arg.rst =================================================================== --- Doc/c-api/arg.rst (révision 81589) +++ Doc/c-api/arg.rst (copie de travail) @@ -530,12 +530,10 @@ and ``None`` is returned. ``U`` (string) [char \*] - Convert a null-terminated C string to a Python unicode object. If the C string - pointer is *NULL*, ``None`` is used. + Same as ``s``. ``U#`` (string) [char \*, int] - Convert a C string and its length to a Python unicode object. If the C string - pointer is *NULL*, the length is ignored and ``None`` is returned. + Same as ``s#``. ``i`` (integer) [int] Convert a plain C :ctype:`int` to a Python integer object. Index: Modules/_ctypes/_ctypes.c =================================================================== --- Modules/_ctypes/_ctypes.c (révision 81589) +++ Modules/_ctypes/_ctypes.c (copie de travail) @@ -4467,7 +4467,7 @@ #endif result = PyObject_CallFunction((PyObject *)&PyCArrayType_Type, - "U(O){s:n,s:O}", + "s(O){s:n,s:O}", name, &PyCArray_Type, "_length_",