From: Martin v. Löwis Date: Tue, 15 Jun 2004 18:49:58 +0000 (+0000) Subject: Return unicode strings from _getfullpathname even on W9X. Fixes #924703 . X-Git-Tag: v2.4a1~176 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=969297f488f314833e8ed591123deff7bd154cbd;p=python Return unicode strings from _getfullpathname even on W9X. Fixes #924703 . --- 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 */