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

This commit is contained in:
Martin v. Löwis 2004-06-15 18:49:58 +00:00
parent 0d6e8f2e65
commit 969297f488

View file

@ -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 */