From e85da7aa4f575e9925afafdb332b17e085c4aea1 Mon Sep 17 00:00:00 2001
From: Antoine Pitrou <solipsis@pitrou.net>
Date: Thu, 6 Jan 2011 18:25:55 +0000
Subject: Issue #7858: Raise an error properly when os.utime() fails under
 Windows on an existing file.

(this does not seem to be easily testable)
---
 Misc/NEWS             | 3 +++
 Modules/posixmodule.c | 1 +
 2 files changed, 4 insertions(+)

diff --git a/Misc/NEWS b/Misc/NEWS
index bdac346..df42025 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -30,6 +30,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #7858: Raise an error properly when os.utime() fails under Windows
+  on an existing file.
+
 - Issue #3839: wsgiref should not override a Content-Length header set by
   the application.  Initial patch by Clovis Fabricio.
 
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 0cd6340..a37efca 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -3256,6 +3256,7 @@ posix_utime(PyObject *self, PyObject *args)
            something is wrong with the file, when it also
            could be the time stamp that gives a problem. */
         win32_error("utime", NULL);
+        goto done;
     }
     Py_INCREF(Py_None);
     result = Py_None;
-- 
cgit v0.12

