Skip to content

Commit dfb6e54

Browse files
authored
Clarify fd inheritance when close_fds=False. (GH-6240)
Clarify the subprocess documentation.
1 parent a9e5d0e commit dfb6e54

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
@@ -459,7 +459,10 @@ functions.
459459
common use of *preexec_fn* to call os.setsid() in the child.
460460

461461
If *close_fds* is true, all file descriptors except :const:`0`, :const:`1` and
462-
:const:`2` will be closed before the child process is executed.
462+
:const:`2` will be closed before the child process is executed. Otherwise
463+
when *close_fds* is false, file descriptors obey their inheritable flag
464+
as described in :ref:`fd_inheritance`.
465+
463466
On Windows, if *close_fds* is true then no handles will be inherited by the
464467
child process unless explicitly passed in the ``handle_list`` element of
465468
:attr:`STARTUPINFO.lpAttributeList`, or by standard handle redirection.

0 commit comments

Comments
 (0)