Index: Python/getargs.c =================================================================== --- Python/getargs.c (révision 81787) +++ Python/getargs.c (copie de travail) @@ -565,7 +565,7 @@ #define UNICODE_DEFAULT_ENCODING(arg) \ - _PyUnicode_AsDefaultEncodedString(arg, NULL) + _PyUnicode_AsDefaultEncodedString(arg) /* Format an error message generated by convertsimple(). */ Index: Python/compile.c =================================================================== --- Python/compile.c (révision 81787) +++ Python/compile.c (copie de travail) @@ -3028,7 +3028,7 @@ case Name_kind: /* optimize away names that can't be reassigned */ id = PyBytes_AS_STRING( - _PyUnicode_AsDefaultEncodedString(e->v.Name.id, NULL)); + _PyUnicode_AsDefaultEncodedString(e->v.Name.id)); if (strcmp(id, "True") == 0) return 1; if (strcmp(id, "False") == 0) return 0; if (strcmp(id, "None") == 0) return 0; Index: Python/bltinmodule.c =================================================================== --- Python/bltinmodule.c (révision 81787) +++ Python/bltinmodule.c (copie de travail) @@ -41,7 +41,7 @@ PyErr_BadInternalCall(); return -1; } - defenc = _PyUnicode_AsDefaultEncodedString(s, NULL); + defenc = _PyUnicode_AsDefaultEncodedString(s); if (!defenc) return -1; codec = _PyCodec_Lookup(PyBytes_AsString(defenc)); @@ -518,7 +518,7 @@ if (PyUnicode_Check(cmd)) { cf->cf_flags |= PyCF_IGNORE_COOKIE; - cmd = _PyUnicode_AsDefaultEncodedString(cmd, NULL); + cmd = _PyUnicode_AsDefaultEncodedString(cmd); if (cmd == NULL) return NULL; } Index: Include/unicodeobject.h =================================================================== --- Include/unicodeobject.h (révision 81787) +++ Include/unicodeobject.h (copie de travail) @@ -694,8 +694,7 @@ */ PyAPI_FUNC(PyObject *) _PyUnicode_AsDefaultEncodedString( - PyObject *unicode, - const char *errors); + PyObject *unicode); /* Returns a pointer to the default encoding (normally, UTF-8) of the Unicode object unicode and the size of the encoded representation Index: Objects/typeobject.c =================================================================== --- Objects/typeobject.c (révision 81787) +++ Objects/typeobject.c (copie de travail) @@ -4901,7 +4901,7 @@ res = slot_tp_repr(self); if (!res) return NULL; - ress = _PyUnicode_AsDefaultEncodedString(res, NULL); + ress = _PyUnicode_AsDefaultEncodedString(res); Py_DECREF(res); return ress; } Index: Objects/unicodeobject.c =================================================================== --- Objects/unicodeobject.c (révision 81787) +++ Objects/unicodeobject.c (copie de travail) @@ -1586,14 +1586,11 @@ return NULL; } -PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode, - const char *errors) +PyObject *_PyUnicode_AsDefaultEncodedString(PyObject *unicode) { PyObject *v = ((PyUnicodeObject *)unicode)->defenc; if (v) return v; - if (errors != NULL) - Py_FatalError("non-NULL encoding in _PyUnicode_AsDefaultEncodedString"); v = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(unicode), PyUnicode_GET_SIZE(unicode), NULL); @@ -1688,7 +1685,7 @@ PyErr_BadArgument(); return NULL; } - bytes = _PyUnicode_AsDefaultEncodedString(unicode, NULL); + bytes = _PyUnicode_AsDefaultEncodedString(unicode); if (bytes == NULL) return NULL; if (psize != NULL) Index: Modules/_dbmmodule.c =================================================================== --- Modules/_dbmmodule.c (révision 81787) +++ Modules/_dbmmodule.c (copie de travail) @@ -219,7 +219,7 @@ return -1; } if (PyUnicode_Check(arg)) { - arg = _PyUnicode_AsDefaultEncodedString(arg, NULL); + arg = _PyUnicode_AsDefaultEncodedString(arg); if (arg == NULL) return -1; } Index: Modules/_struct.c =================================================================== --- Modules/_struct.c (révision 81787) +++ Modules/_struct.c (copie de travail) @@ -464,7 +464,7 @@ np_char(char *p, PyObject *v, const formatdef *f) { if (PyUnicode_Check(v)) { - v = _PyUnicode_AsDefaultEncodedString(v, NULL); + v = _PyUnicode_AsDefaultEncodedString(v); if (v == NULL) return -1; } @@ -1487,7 +1487,7 @@ int isstring; void *p; if (PyUnicode_Check(v)) { - v = _PyUnicode_AsDefaultEncodedString(v, NULL); + v = _PyUnicode_AsDefaultEncodedString(v); if (v == NULL) return -1; } @@ -1513,7 +1513,7 @@ int isstring; void *p; if (PyUnicode_Check(v)) { - v = _PyUnicode_AsDefaultEncodedString(v, NULL); + v = _PyUnicode_AsDefaultEncodedString(v); if (v == NULL) return -1; }