Skip to content

Commit 5ffbb05

Browse files
bpo-14879: [doc] clarify how to check for errors from subprocess.Popen(..., shell=True) (GH-26755) (GH-27289)
(cherry picked from commit 50ffbe3) Co-authored-by: Jack DeVries <[email protected]>
1 parent 654ead2 commit 5ffbb05

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Doc/library/subprocess.rst

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

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

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

0 commit comments

Comments
 (0)