Kaydet (Commit) 969297f4 authored tarafından Martin v. Löwis's avatar Martin v. Löwis

Return unicode strings from _getfullpathname even on W9X. Fixes #924703 .

üst 0d6e8f2e
...@@ -1736,6 +1736,10 @@ posix__getfullpathname(PyObject *self, PyObject *args) ...@@ -1736,6 +1736,10 @@ posix__getfullpathname(PyObject *self, PyObject *args)
if (!GetFullPathName(inbuf, sizeof(outbuf)/sizeof(outbuf[0]), if (!GetFullPathName(inbuf, sizeof(outbuf)/sizeof(outbuf[0]),
outbuf, &temp)) outbuf, &temp))
return win32_error("GetFullPathName", inbuf); 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); return PyString_FromString(outbuf);
} /* end of posix__getfullpathname */ } /* end of posix__getfullpathname */
#endif /* MS_WINDOWS */ #endif /* MS_WINDOWS */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment