From 4e7d2d481a5ab86977bd9dbafbceabec7b48883b Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 5 Nov 2012 01:20:58 +0100 Subject: Issue #15478: Oops, fix regression in os.open() on Windows os.open() uses _wopen() which sets errno, not the Windows error code. --- Modules/posixmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 8cedb9e..3f863a8 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; } -- cgit v0.12