diff -r 5366fee4fef8 Misc/NEWS --- a/Misc/NEWS Thu May 28 07:58:44 2009 +0200 +++ b/Misc/NEWS Thu May 28 05:24:09 2009 -0400 @@ -1081,6 +1081,8 @@ - Issue #5228: Make functools.partial objects can now be pickled. +- Issue #3425: Always use utimes() when it is available. + Tests ----- diff -r 5366fee4fef8 Modules/posixmodule.c --- a/Modules/posixmodule.c Thu May 28 07:58:44 2009 +0200 +++ b/Modules/posixmodule.c Thu May 28 05:24:09 2009 -0400 @@ -2951,9 +2951,15 @@ return NULL; if (arg == Py_None) { /* optional time values not given */ +#ifdef HAVE_UTIMES + Py_BEGIN_ALLOW_THREADS + res = utimes(path, NULL); + Py_END_ALLOW_THREADS +#else Py_BEGIN_ALLOW_THREADS res = utime(path, NULL); Py_END_ALLOW_THREADS +#endif /* HAVE_UTIMES */ } else if (!PyTuple_Check(arg) || PyTuple_Size(arg) != 2) { PyErr_SetString(PyExc_TypeError,