[issue33079] subprocess: document the interaction between subprocess.Popen and os.set_inheritable

2018-03-25 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

I clarified the docs to mention that the inheritable flag is heeded when 
close_fds=False in https://github.com/python/cpython/pull/6240/files

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33079] subprocess: document the interaction between subprocess.Popen and os.set_inheritable

2018-03-25 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

I assumed simon meant "close_fds=False" when he wrote open_fds = True.

Regardless, supplying any pass_fds forces close_fds=True behavior.

File descriptors listed in pass_fds are explicitly set inheritable from within 
the child process prior to calling exec().  See the start of child_exec() 
within Modules/_posixsubprocess.c.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33079] subprocess: document the interaction between subprocess.Popen and os.set_inheritable

2018-03-25 Thread Gregory P. Smith

Change by Gregory P. Smith :


--
keywords: +patch
pull_requests: +5976
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33079] subprocess: document the interaction between subprocess.Popen and os.set_inheritable

2018-03-25 Thread Martin Panter

Martin Panter  added the comment:

There is no “open_fds” parameter as far as I know. I presume you meant 
heritable descriptors are still closed with close_fds=True (not open_fds=False).

Are you sure about the second part? In my experiments on Linux, unless I use 
“pass_fds” or one of the “stdin” etc parameters, a non-heritable descriptor is 
never passed to the child, no matter what I use for “close_fds”.

Reading through Issue 6559, the intention of “pass_fds” seems to be to list 
extra file descriptors, in addition to 0, 1 and 2 that are normally passed. The 
documentation says descriptors greater than 2 are closed (due to 
close_fds=True), but in reality the “pass_fds” descriptors seem to be always 
left open, even when they are marked non-heritable.

--
nosy: +martin.panter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33079] subprocess: document the interaction between subprocess.Popen and os.set_inheritable

2018-03-15 Thread Ned Deily

Change by Ned Deily :


--
nosy: +gregory.p.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33079] subprocess: document the interaction between subprocess.Popen and os.set_inheritable

2018-03-15 Thread Simon Lipp

New submission from Simon Lipp :

>From current `os` documentation:

> A file descriptor has an “inheritable” flag which indicates if the file 
> descriptor can be inherited by child processes

from current `subprocess` documentation:

> If close_fds is true, all file descriptors except 0, 1 and 2 will be closed 
> before the child process is executed

It would be helpful to explicitly specify that subprocess.Popen does not takes 
into account the inheritable flag ; thas is, that inheritable fds will still be 
closed with open_fds = False, and that non-inheritable fds will still be kept 
with open_fds = True.

--
assignee: docs@python
components: Documentation
messages: 313868
nosy: docs@python, sloonz
priority: normal
severity: normal
status: open
title: subprocess: document the interaction between subprocess.Popen and 
os.set_inheritable
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com