[Python-Dev] PEP 433: Add cloexec argument to functions creating file descriptors

Jeff Allen "ja...py" at farowl.co.uk
Fri Jan 18 00:40:32 CET 2013


On 17/01/2013 13:02, Victor Stinner wrote:
> 2013/1/13 Jeff Allen<ja...py at farowl.co.uk>:
>> I think io, meaning _io and _pyio really, would be amongst the impacted
>> modules, and should perhaps be in the examples. (I am currently working on
>> the Jython implementation of the _io module.) It seems to me that io.open,
>> and probably all the constructors, such as _io.FileIO, would need the extra
>> information as a mode or a boolean argument like closefd. This may be a
>> factor in your choice above.
> open() is listed in the PEP: open is io.open. I plan to add cloexec
> parameter to open() and FileIO constructor (and so io.open and
> _pyio.open). Examples:
>
> rawfile = io.FileIO("test.txt", "r", cloexec=True)
> textfile = open("text.txt", "r", cloexec=True)
Ok it fell under "too obvious to mention". And my ignorance of v3.x, 
sorry. (We're still working on 2.7 in Jython, where open is from 
__builtin__.) Thanks for the reply.

Jeff Allen


More information about the Python-Dev mailing list