Issue #13560: Locale codec functions use the classic "errors" parameter,

instead of surrogateescape

So it would be possible to support more error handlers later.
This commit is contained in:
Victor Stinner 2011-12-17 05:47:23 +01:00
parent ab59594326
commit 1b57967b96
6 changed files with 49 additions and 17 deletions

View file

@ -355,7 +355,7 @@ PyErr_SetFromErrnoWithFilenameObject(PyObject *exc, PyObject *filenameObject)
#ifndef MS_WINDOWS
if (i != 0) {
char *s = strerror(i);
message = PyUnicode_DecodeLocale(s, 1);
message = PyUnicode_DecodeLocale(s, "surrogateescape");
}
else {
/* Sometimes errno didn't get set */