[issue22722] inheritable pipes are unwieldy without os.pipe2

2022-03-24 Thread Irit Katriel
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 ->

[issue22722] inheritable pipes are unwieldy without os.pipe2

2014-10-27 Thread STINNER Victor
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.

[issue22722] inheritable pipes are unwieldy without os.pipe2

2014-10-25 Thread STINNER Victor
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 ___

[issue22722] inheritable pipes are unwieldy without os.pipe2

2014-10-24 Thread Buck Golemon
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

[issue22722] inheritable pipes are unwieldy without os.pipe2

2014-10-24 Thread R. David Murray
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

[issue22722] inheritable pipes are unwieldy without os.pipe2

2014-10-24 Thread Buck Golemon
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

[issue22722] inheritable pipes are unwieldy without os.pipe2

2014-10-24 Thread Antoine Pitrou
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