[New-bugs-announce] [issue22722] inheritable pipes are unwieldy without os.pipe2

Buck Golemon report at bugs.python.org
Fri Oct 24 20:25:14 CEST 2014


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 since set_inheritable() code is invoked twice, where I'd prefer to invoke it zero times (or at most once).

Would it be acceptable to implement a pipe2 shim for those platforms?
If so, I'll (attempt to) provide a patch.

Alternatively, can we change the signature of os.pipe() to os.pipe(flags=O_CLOEXEC) ?  In my opinion, such a function could be implemented via pipe2 on those platforms that provide it, obviating any need for an os.pipe2.

Please tell me which patch to provide, if any.

----------
messages: 229947
nosy: bukzor
priority: normal
severity: normal
status: open
title: inheritable pipes are unwieldy without os.pipe2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22722>
_______________________________________


More information about the New-bugs-announce mailing list