Skip to content

Commit 59af91f

Browse files
committed
bpo-19764: Documentation update
1 parent 167590b commit 59af91f

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

Doc/library/subprocess.rst

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ The :class:`STARTUPINFO` class and following constants are only available
750750
on Windows.
751751

752752
.. class:: STARTUPINFO(*, dwFlags=0, hStdInput=None, hStdOutput=None, \
753-
hStdError=None, wShowWindow=0)
753+
hStdError=None, wShowWindow=0, lpAttributeList=None)
754754

755755
Partial support of the Windows
756756
`STARTUPINFO <https://msdn.microsoft.com/en-us/library/ms686331(v=vs.85).aspx>`__
@@ -812,18 +812,19 @@ on Windows.
812812
Sequence of handles that will be inherited. *close_fds* must be true if
813813
non-empty.
814814

815-
The handles must be made inheritable by
816-
:func:`os.set_handle_inheritable` or :class:`OSError` will be raised
817-
with Windows error `ERROR_INVALID_PARAMETER` (87). They only have to be
818-
inheritable during the process creation and can be made non-inheritable
819-
right afterwards.
820-
821-
Note that inheritable handles can be inherited by any process created
822-
that is set to inherit all handles. Other process creation functions
823-
might not be using an explicit handle list to avoid inheriting all
824-
handles like subprocess does, so you should be careful in using them
825-
when you have handles marked as inheritable. Also note that standard
826-
handles redirection requires creating inheritable handles temporarily.
815+
The handles must be temporarily made inheritable by
816+
:func:`os.set_handle_inheritable` when passed to the :class:`Popen`
817+
constructor, else :class:`OSError` will be raised with Windows error
818+
`ERROR_INVALID_PARAMETER` (87).
819+
820+
.. warning::
821+
822+
In a multithreaded process, use caution to avoid leaking handles
823+
that are marked inheritable when combining this feature with
824+
concurrent calls to other process creation functions that inherit
825+
all handles such as :func:`os.system`. This also applies to
826+
standard handle redirection, which temporarily creates inheritable
827+
handles.
827828

828829
.. versionadded:: 3.7
829830

0 commit comments

Comments
 (0)