[Python-checkins] bpo-35537: Document posix_spawn() change in subprocess (GH-11668)

Victor Stinner webhook-mailer at python.org
Thu Apr 25 08:30:22 EDT 2019


https://github.com/python/cpython/commit/d7befad328ad1a6d1f812be2bf154c1cd1e01fbc
commit: d7befad328ad1a6d1f812be2bf154c1cd1e01fbc
branch: master
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2019-04-25T14:30:16+02:00
summary:

bpo-35537: Document posix_spawn() change in subprocess (GH-11668)

Document that subprocess.Popen no longer raise an exception on error
like missing program on very specific platforms when using
os.posix_spawn() is used.

files:
M Doc/library/subprocess.rst
M Doc/whatsnew/3.8.rst

diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index ca0813c7830a..3280c95cacbb 100644
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -567,6 +567,13 @@ functions.
       Popen destructor now emits a :exc:`ResourceWarning` warning if the child
       process is still running.
 
+   .. versionchanged:: 3.8
+      Popen can use :func:`os.posix_spawn` in some cases for better
+      performance. On Windows Subsystem for Linux and QEMU User Emulation,
+      Popen constructor using :func:`os.posix_spawn` no longer raise an
+      exception on errors like missing program, but the child process fails
+      with a non-zero :attr:`~Popen.returncode`.
+
 
 Exceptions
 ^^^^^^^^^^
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst
index ae8163a1b156..344656b9288f 100644
--- a/Doc/whatsnew/3.8.rst
+++ b/Doc/whatsnew/3.8.rst
@@ -729,6 +729,12 @@ Changes in Python behavior
 Changes in the Python API
 -------------------------
 
+* :class:`subprocess.Popen` can now use :func:`os.posix_spawn` in some cases
+  for better performance. On Windows Subsystem for Linux and QEMU User
+  Emulation, Popen constructor using :func:`os.posix_spawn` no longer raise an
+  exception on errors like missing program, but the child process fails with a
+  non-zero :attr:`~Popen.returncode`.
+
 * The :meth:`imap.IMAP4.logout` method no longer ignores silently arbitrary
   exceptions.
 



More information about the Python-checkins mailing list