From 969297f488f314833e8ed591123deff7bd154cbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Tue, 15 Jun 2004 18:49:58 +0000 Subject: Return unicode strings from _getfullpathname even on W9X. Fixes #924703 . --- Modules/posixmodule.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index a375dcb..474e00e 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 */ -- cgit v0.12