Charles-François Natali <neolo...@free.fr> added the comment: > To exclude races (in concurrent threads), this two ops should be done under > lock (GIL?)
That won't work, because open(), like other slow syscalls, is called without the GIL held. Furthermore, it wouldn't be atomic anyway (imagine a fork is done from a C extension without the GIL held). So we would end up tricking people into using a 'e' flag that, contrarily to GNU fopen(), would not be atomic. Since the fopen() 'e' flag is only available on platform supporting O_CLOEXEC, you're exactly as portable using the fdopen() trick. And you're sure of what's happening. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12105> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com