From 082b0f098e1e5c48c6fa4cd3de4b869c14684aad Mon Sep 17 00:00:00 2001 From: Mark Hammond Date: Tue, 4 May 2004 08:07:49 +0000 Subject: [PATCH] Fix [ 947405 ] os.utime() raises bad exception for unicode filenames. --- Modules/posixmodule.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 14cf82fdcbaa..4738d800979f 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -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 -- 2.47.3