From dfb6e54dd8dbd735f55109ad8ee9dfcb6178ede9 Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Sun, 25 Mar 2018 10:27:59 -0700 Subject: [PATCH] Clarify fd inheritance when close_fds=False. (GH-6240) Clarify the subprocess documentation. --- Doc/library/subprocess.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index db7a88af6b..fbf2c3d9fa 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -459,7 +459,10 @@ functions. common use of *preexec_fn* to call os.setsid() in the child. If *close_fds* is true, all file descriptors except :const:`0`, :const:`1` and - :const:`2` will be closed before the child process is executed. + :const:`2` will be closed before the child process is executed. Otherwise + when *close_fds* is false, file descriptors obey their inheritable flag + as described in :ref:`fd_inheritance`. + On Windows, if *close_fds* is true then no handles will be inherited by the child process unless explicitly passed in the ``handle_list`` element of :attr:`STARTUPINFO.lpAttributeList`, or by standard handle redirection. -- 2.40.0