You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly, I believe that by default all handles are non-inheritable. But I haven't checked everywhere you're creating them though - certainly the returned pipes from os.pipe are explicitly noninheritable.
Most likely you should just use os.set_inheritable on all platforms, which does what you need. It was added in Python 3.4, so once 2.7 is no longer a concern this is probably the easiest way forward. It knows how to convert FDs to handles on Windows.
Finally, I came across this because I'm trying to bring up a Python environment on Windows that doesn't include ctypes, and this showed up on my list of "concerns". I'll patch my own to use the builtin function, but figured I'd mention that the current code doesn't work.
The text was updated successfully, but these errors were encountered:
The Windows implementation of
set_close_exec
https://github.com/tornadoweb/tornado/blob/master/tornado/platform/windows.py currently can never work becauseSetHandleInformation
needs an OS handle, but everywhere this function is called it is given a file descriptor.Firstly, I believe that by default all handles are non-inheritable. But I haven't checked everywhere you're creating them though - certainly the returned pipes from
os.pipe
are explicitly noninheritable.Most likely you should just use
os.set_inheritable
on all platforms, which does what you need. It was added in Python 3.4, so once 2.7 is no longer a concern this is probably the easiest way forward. It knows how to convert FDs to handles on Windows.Finally, I came across this because I'm trying to bring up a Python environment on Windows that doesn't include ctypes, and this showed up on my list of "concerns". I'll patch my own to use the builtin function, but figured I'd mention that the current code doesn't work.
The text was updated successfully, but these errors were encountered: