]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix [ 947405 ] os.utime() raises bad exception for unicode filenames.
authorMark Hammond <mhammond@skippinet.com.au>
Tue, 4 May 2004 08:07:49 +0000 (08:07 +0000)
committerMark Hammond <mhammond@skippinet.com.au>
Tue, 4 May 2004 08:07:49 +0000 (08:07 +0000)
Modules/posixmodule.c

index 14cf82fdcbaa72b635fd239fb2e9967d475c13fc..4738d800979f5c0a93817cc25573f35df6521683 100644 (file)
@@ -1997,8 +1997,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