Index: Python/pythonrun.c =================================================================== --- Python/pythonrun.c (révision 78666) +++ Python/pythonrun.c (copie de travail) @@ -153,7 +153,10 @@ if (!name) goto error; - codeset = strdup(_PyUnicode_AsString(name)); + codeset = _PyUnicode_AsString(name); + if (!codeset) + goto error; + codeset = strdup(codeset); Py_DECREF(name); return codeset; @@ -1047,6 +1050,8 @@ if (!oenc) return -1; enc = _PyUnicode_AsString(oenc); + if (enc == NULL) + return -1; } v = PySys_GetObject("ps1"); if (v != NULL) { @@ -1054,7 +1059,7 @@ if (v == NULL) PyErr_Clear(); else if (PyUnicode_Check(v)) - ps1 = _PyUnicode_AsString(v); + ps1 = _PyUnicode_AsStringOrDefault(v, ps1); } w = PySys_GetObject("ps2"); if (w != NULL) { @@ -1062,7 +1067,7 @@ if (w == NULL) PyErr_Clear(); else if (PyUnicode_Check(w)) - ps2 = _PyUnicode_AsString(w); + ps2 = _PyUnicode_AsStringOrDefault(w, ps2); } arena = PyArena_New(); if (arena == NULL) {