This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients alexey-smirnov, amaury.forgeotdarc, neologix, socketpair, vstinner
Date 2011-05-20.09:18:09
SpamBayes Score 2.410284e-09
Marked as misclassified No
Message-id <1305883091.54.0.121840333537.issue12105@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2011-05-20 09:18:11neologixsetrecipients: + neologix, amaury.forgeotdarc, vstinner, socketpair, alexey-smirnov
2011-05-20 09:18:11neologixsetmessageid: <1305883091.54.0.121840333537.issue12105@psf.upfronthosting.co.za>
2011-05-20 09:18:10neologixlinkissue12105 messages
2011-05-20 09:18:09neologixcreate