Replace PyUnicode_Decode(buf, strlen(buf), Py_FileSystemDefaultEncoding,
"surrogateescape") by PyUnicode_DecodeFSDefault(val).
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 0d6f8f0..a48f233 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -2031,7 +2031,7 @@
return posix_error();
if (use_bytes)
return PyBytes_FromStringAndSize(buf, strlen(buf));
- return PyUnicode_Decode(buf, strlen(buf), Py_FileSystemDefaultEncoding,"surrogateescape");
+ return PyUnicode_DecodeFSDefault(buf);
}
PyDoc_STRVAR(posix_getcwd__doc__,