Eryk Sun <eryk...@gmail.com> added the comment:

> This is still the case on windows as the pipes created to talk to the
> process might be inherited by two or more simultaneous CreateProcess 
> calls.

subprocess already uses PROC_THREAD_ATTRIBUTE_HANDLE_LIST to address this 
problem, at least between its own subprocess.Popen calls. The handles in the 
list still have to be inheritable, so it does not solve the problem with 
os.system and os.spawn* calls that are concurrent with subprocess.Popen -- nor 
extension-module, ctypes, cffi, or PyWin32 code  in the wild that inherits 
handles without PROC_THREAD_ATTRIBUTE_HANDLE_LIST. There's a warning about this 
in the docs:

https://docs.python.org/3/library/subprocess.html#subprocess.STARTUPINFO.lpAttributeList

It's why we can't use the handle list to implement pass_fds in Windows and why 
the general capability is buried in STARTUPINFO, instead of being exposed as a 
high-level Popen parameter.

----------
nosy: +eryksun

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue19809>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to