Irit Katriel added the comment:
Closing as this seems abandoned.
Buck, if you want to bring it up again and explain the use case, please reopen
this issue, create a new issue or post to python-ideas.
--
nosy: +iritkatriel
resolution: -> rejected
stage: -> resolved
status: open ->
STINNER Victor added the comment:
Would it be acceptable to implement a pipe2 shim for those platforms?
If I understand correctly, you propose to add an option inheritable parameter
to os.pipe():
def os.pipe(inheritable=False):
...
The PEP 446 was written to fix race conditions.
STINNER Victor added the comment:
os.dup2() is really a special case for inheritable file descriptors. See
the PEP 446.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22722
___
New submission from Buck Golemon:
In order to make an inheritable pipe, the code is quite a bit different between
posixes that implement pipe2 and those that don't (osx, mainly). I believe the
officially-supported path is to call os.pipe() then os.setinheritable(). This
seems objectionable
R. David Murray added the comment:
pipe2 can also be used to set O_NONBLOCK, so no, that specific API change
wouldn't obsolete pipe2. So, a shim for pipe2 would be the way to go, since
that's currently the de-facto standard way of passing flags on pipe creation in
unix land. (The os module
Buck Golemon added the comment:
I notice that dup2 grew an `inheritable=True` argument in 3.4.
This might be a good precedent to use here, as a third option.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22722
Antoine Pitrou added the comment:
This seems objectionable since set_inheritable() code is invoked
twice, where I'd prefer to invoke it zero times (or at most once).
Does it make a difference in the grand scheme of things? If you're forking a
process, you're usually doing something heavy