From: Victor Stinner Date: Mon, 5 Nov 2012 00:20:58 +0000 (+0100) Subject: Issue #15478: Oops, fix regression in os.open() on Windows X-Git-Tag: v3.4.0a1~2079 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e7d2d481a5ab86977bd9dbafbceabec7b48883b;p=python Issue #15478: Oops, fix regression in os.open() on Windows os.open() uses _wopen() which sets errno, not the Windows error code. --- diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 8cedb9eb16..3f863a882d 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -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; }