Skip to content

Commit d0c6175

Browse files
bpo-14879: [doc] clarify how to check for errors from subprocess.Popen(..., shell=True) (GH-26755) (GH-27288)
(cherry picked from commit 50ffbe3) Co-authored-by: Jack DeVries <58614260+jdevries3133@users.noreply.github.com>
1 parent 0fb4b75 commit d0c6175

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Doc/library/subprocess.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,10 @@ execute, will be re-raised in the parent.
689689

690690
The most common exception raised is :exc:`OSError`. This occurs, for example,
691691
when trying to execute a non-existent file. Applications should prepare for
692-
:exc:`OSError` exceptions.
692+
:exc:`OSError` exceptions. Note that, when ``"shell=True"``, :exc:`OSError`
693+
will be raised by the child only if the selected shell itself was not found.
694+
To determine if the shell failed to find the requested application, it is
695+
necessary to check the return code or output from the subprocess.
693696

694697
A :exc:`ValueError` will be raised if :class:`Popen` is called with invalid
695698
arguments.

0 commit comments

Comments
 (0)