]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-14879: [doc] clarify how to check for errors from subprocess.Popen(..., shell...
authorJack DeVries <58614260+jdevries3133@users.noreply.github.com>
Thu, 22 Jul 2021 18:23:29 +0000 (14:23 -0400)
committerGitHub <noreply@github.com>
Thu, 22 Jul 2021 18:23:29 +0000 (19:23 +0100)
Doc/library/subprocess.rst

index 56b6b6e0015734e84d709613b3a8be606fdb5865..6c127dcfd45438c67d0ac9ed5b9b291acdea019b 100644 (file)
@@ -689,7 +689,10 @@ execute, will be re-raised in the parent.
 
 The most common exception raised is :exc:`OSError`.  This occurs, for example,
 when trying to execute a non-existent file.  Applications should prepare for
-:exc:`OSError` exceptions.
+:exc:`OSError` exceptions. Note that, when ``"shell=True"``, :exc:`OSError`
+will be raised by the child only if the selected shell itself was not found.
+To determine if the shell failed to find the requested application, it is
+necessary to check the return code or output from the subprocess.
 
 A :exc:`ValueError` will be raised if :class:`Popen` is called with invalid
 arguments.