summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMark Hammond <mhammond@skippinet.com.au>2004-05-04 08:10:37 (GMT)
committerMark Hammond <mhammond@skippinet.com.au>2004-05-04 08:10:37 (GMT)
commit2d5914b17e79803251693531ef45815b42da3933 (patch)
tree7a9c4fb78a916c15a6699da3714e96a37670063c /Modules
parent9f1340b9f231f920fcf70ce2f8ea0c0e3a322dd9 (diff)
downloadcpython-2d5914b17e79803251693531ef45815b42da3933.zip
cpython-2d5914b17e79803251693531ef45815b42da3933.tar.gz
cpython-2d5914b17e79803251693531ef45815b42da3933.tar.bz2
Fix [ 947405 ] os.utime() raises bad exception for unicode filenames
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index aec9f74..1df5af0 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -2004,8 +2004,13 @@ posix_utime(PyObject *self, PyObject *args)
Py_END_ALLOW_THREADS
#endif /* HAVE_UTIMES */
}
- if (res < 0)
+ if (res < 0) {
+#ifdef Py_WIN_WIDE_FILENAMES
+ if (have_unicode_filename)
+ return posix_error_with_unicode_filename(wpath);
+#endif /* Py_WIN_WIDE_FILENAMES */
return posix_error_with_filename(path);
+ }
Py_INCREF(Py_None);
return Py_None;
#undef UTIME_ARG