[Python-checkins] cpython: Issue #15478: Oops, fix regression in os.open() on Windows

victor.stinner python-checkins at python.org
Mon Nov 5 01:21:14 CET 2012


http://hg.python.org/cpython/rev/817a90752470
changeset:   80259:817a90752470
parent:      80257:bcdb3836be72
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Mon Nov 05 01:20:58 2012 +0100
summary:
  Issue #15478: Oops, fix regression in os.open() on Windows

os.open() uses _wopen() which sets errno, not the Windows error code.

files:
  Modules/posixmodule.c |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -7057,7 +7057,7 @@
     Py_END_ALLOW_THREADS
 
     if (fd == -1) {
-        return_value = path_error(&path);
+        PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path.object);
         goto exit;
     }
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list