summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Modules/posixmodule.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index a375dcb6f5..474e00e888 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -1736,6 +1736,10 @@ posix__getfullpathname(PyObject *self, PyObject *args)
if (!GetFullPathName(inbuf, sizeof(outbuf)/sizeof(outbuf[0]),
outbuf, &temp))
return win32_error("GetFullPathName", inbuf);
+ if (PyUnicode_Check(PyTuple_GetItem(args, 0))) {
+ return PyUnicode_Decode(outbuf, strlen(outbuf),
+ Py_FileSystemDefaultEncoding, NULL);
+ }
return PyString_FromString(outbuf);
} /* end of posix__getfullpathname */
#endif /* MS_WINDOWS */