STINNER Victor added the comment: Here is a work-in-progress patch to test my idea: add "e" flag to open().
Limitations/TODO: * The unit test doesn't work on Windows (it requires fcntl) * "e" mode and the opener argument are exclusive: if O_CLOEXEC and O_NOINHERINT are missing, I don't see how the opener can be aware of the "e" flag. Or should we call fcntl(F_SETFD, flags|FD_CLOEXEC) after the opener? It would be strange: the opener is supposed to be the only one to decide how the file is opened, isn't it? * NotImplementedError is raised if O_CLOEXEC, O_NOINHERIT and fcntl() are missing I only tested my patch on Linux (3.6). ---------- keywords: +patch Added file: http://bugs.python.org/file28561/open_mode_e.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16850> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com