]> granicus.if.org Git - python/commitdiff
Return unicode strings from _getfullpathname even on W9X. Fixes #924703 .
authorMartin v. Löwis <martin@v.loewis.de>
Tue, 15 Jun 2004 18:49:58 +0000 (18:49 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Tue, 15 Jun 2004 18:49:58 +0000 (18:49 +0000)
Modules/posixmodule.c

index a375dcb6f534020814834e76d57f360b090ed808..474e00e888b071308df94c2d27de0827bbbceb16 100644 (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 */