summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2004-06-15 18:49:58 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2004-06-15 18:49:58 (GMT)
commit969297f488f314833e8ed591123deff7bd154cbd (patch)
treed07f85ea6ed1bf51c73564ced1428c6ba9bad9af /Modules/posixmodule.c
parent0d6e8f2e65a9ce2366c8ea9f7bacdc7778255090 (diff)
downloadcpython-969297f488f314833e8ed591123deff7bd154cbd.zip
cpython-969297f488f314833e8ed591123deff7bd154cbd.tar.gz
cpython-969297f488f314833e8ed591123deff7bd154cbd.tar.bz2
Return unicode strings from _getfullpathname even on W9X. Fixes #924703 .
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c4
1 files changed, 4 insertions, 0 deletions
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 */