]> granicus.if.org Git - python/commitdiff
Issue #15478: Oops, fix regression in os.open() on Windows
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 5 Nov 2012 00:20:58 +0000 (01:20 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 5 Nov 2012 00:20:58 +0000 (01:20 +0100)
os.open() uses _wopen() which sets errno, not the Windows error code.

Modules/posixmodule.c

index 8cedb9eb1652c0d6849a0362932a6de400efcd18..3f863a882dd2eac3f5f31df1bb11f9211bc8ab9f 100644 (file)
@@ -7057,7 +7057,7 @@ posix_open(PyObject *self, PyObject *args, PyObject *kwargs)
     Py_END_ALLOW_THREADS
 
     if (fd == -1) {
-        return_value = path_error(&path);
+        PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path.object);
         goto exit;
     }