]> granicus.if.org Git - python/commitdiff
Fix [ 947405 ] os.utime() raises bad exception for unicode filenames
authorMark Hammond <mhammond@skippinet.com.au>
Tue, 4 May 2004 08:10:37 +0000 (08:10 +0000)
committerMark Hammond <mhammond@skippinet.com.au>
Tue, 4 May 2004 08:10:37 +0000 (08:10 +0000)
Modules/posixmodule.c

index aec9f745f051cea2fceb2f442a94a55e38ffc505..1df5af0329f6367b6df7d305a7b3e487563942c8 100644 (file)
@@ -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