2013/1/7 Gregory P. Smith <g...@krypto.org>: > > > > On Mon, Jan 7, 2013 at 4:03 PM, Benjamin Peterson <benja...@python.org> > wrote: >> >> 2013/1/7 Victor Stinner <victor.stin...@gmail.com>: >> > Hi, >> > >> > I would like add a new flag to open() mode to close the file on exec: >> > "e". This feature exists using different APIs depending on the OS and >> > OS version: O_CLOEXEC, FD_CLOEXEC and O_NOINHERIT. Do you consider >> > that such flag would be interesting? >> >> I'm not sure it's worth cluttering the open() interface with such a >> non-portable option. People requiring such control should use the >> low-level os.open interface. > > > The ability to supply such flags really belongs on _all_ high or low level > file descriptor creating APIs so that things like subprocess_cloexec_pipe() > would not be necessary: > http://hg.python.org/cpython/file/0afa7b323abb/Modules/_posixsubprocess.c#l729
I think the open() interface should have consistent and non-conditional support features to the maximum extent possible. The recent addition of "x" is a good example I think. The myriad cloexec APIs between different platforms suggests to me that using this features requires understanding its various quirks on different platforms. -- Regards, Benjamin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com