Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 969297f

Browse files
committed
Return unicode strings from _getfullpathname even on W9X. Fixes #924703 .
1 parent 0d6e8f2 commit 969297f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Modules/posixmodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1736,6 +1736,10 @@ posix__getfullpathname(PyObject *self, PyObject *args)
17361736
if (!GetFullPathName(inbuf, sizeof(outbuf)/sizeof(outbuf[0]),
17371737
outbuf, &temp))
17381738
return win32_error("GetFullPathName", inbuf);
1739+
if (PyUnicode_Check(PyTuple_GetItem(args, 0))) {
1740+
return PyUnicode_Decode(outbuf, strlen(outbuf),
1741+
Py_FileSystemDefaultEncoding, NULL);
1742+
}
17391743
return PyString_FromString(outbuf);
17401744
} /* end of posix__getfullpathname */
17411745
#endif /* MS_WINDOWS */

0 commit comments

Comments
 (0)