Commit 024364a8 authored by Victor Stinner's avatar Victor Stinner

Merge 3.5 (os.waitpid)

parents 13e457c8 d3ffd327
...@@ -2077,6 +2077,12 @@ class PidTests(unittest.TestCase): ...@@ -2077,6 +2077,12 @@ class PidTests(unittest.TestCase):
# We are the parent of our subprocess # We are the parent of our subprocess
self.assertEqual(int(stdout), os.getpid()) self.assertEqual(int(stdout), os.getpid())
def test_waitpid(self):
args = [sys.executable, '-c', 'pass']
pid = os.spawnv(os.P_NOWAIT, args[0], args)
status = os.waitpid(pid, 0)
self.assertEqual(status, (pid, 0))
# The introduction of this TestCase caused at least two different errors on # The introduction of this TestCase caused at least two different errors on
# *nix buildbots. Temporarily skip this to let the buildbots move along. # *nix buildbots. Temporarily skip this to let the buildbots move along.
......
...@@ -103,6 +103,8 @@ Core and Builtins ...@@ -103,6 +103,8 @@ Core and Builtins
Library Library
------- -------
- Issue #25118: Fix a regression of Python 3.5.0 in os.waitpid() on Windows.
- Issue #24684: socket.socket.getaddrinfo() now calls - Issue #24684: socket.socket.getaddrinfo() now calls
PyUnicode_AsEncodedString() instead of calling the encode() method of the PyUnicode_AsEncodedString() instead of calling the encode() method of the
host, to handle correctly custom string with an encode() method which doesn't host, to handle correctly custom string with an encode() method which doesn't
......
...@@ -7021,7 +7021,7 @@ os_waitpid_impl(PyModuleDef *module, Py_intptr_t pid, int options) ...@@ -7021,7 +7021,7 @@ os_waitpid_impl(PyModuleDef *module, Py_intptr_t pid, int options)
res = _cwait(&status, pid, options); res = _cwait(&status, pid, options);
Py_END_ALLOW_THREADS Py_END_ALLOW_THREADS
} while (res < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals())); } while (res < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
if (res != 0) if (res < 0)
return (!async_err) ? posix_error() : NULL; return (!async_err) ? posix_error() : NULL;
/* shift the status left a byte so this is more like the POSIX waitpid */ /* shift the status left a byte so this is more like the POSIX waitpid */
...@@ -7731,7 +7731,7 @@ os_open_impl(PyModuleDef *module, path_t *path, int flags, int mode, ...@@ -7731,7 +7731,7 @@ os_open_impl(PyModuleDef *module, path_t *path, int flags, int mode,
} while (fd < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals())); } while (fd < 0 && errno == EINTR && !(async_err = PyErr_CheckSignals()));
_Py_END_SUPPRESS_IPH _Py_END_SUPPRESS_IPH
if (fd == -1) { if (fd < 0) {
if (!async_err) if (!async_err)
PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path->object); PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path->object);
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment