mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
Even though Python marks any handles it opens as non-inheritable there is still a race when using `subprocess.Popen` since creating a process with redirected stdio requires temporarily creating inheritable handles. By implementing support for `subprocess.Popen(close_fds=True)` we fix this race. In order to implement this we use PROC_THREAD_ATTRIBUTE_HANDLE_LIST which is available since Windows Vista. Which allows to pass an explicit list of handles to inherit when creating a process. This commit also adds `STARTUPINFO.lpAttributeList["handle_list"]` which can be used to control PROC_THREAD_ATTRIBUTE_HANDLE_LIST directly. |
||
|---|---|---|
| .. | ||
| 2.0.rst | ||
| 2.1.rst | ||
| 2.2.rst | ||
| 2.3.rst | ||
| 2.4.rst | ||
| 2.5.rst | ||
| 2.6.rst | ||
| 2.7.rst | ||
| 3.0.rst | ||
| 3.1.rst | ||
| 3.2.rst | ||
| 3.3.rst | ||
| 3.4.rst | ||
| 3.5.rst | ||
| 3.6.rst | ||
| 3.7.rst | ||
| changelog.rst | ||
| index.rst | ||