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-19.20:34:19
SpamBayes Score 3.0514748e-08
Marked as misclassified No
Message-id <BANLkTi=mHeNQeixwPEK08Y5QJ1BZ8DhF+g@mail.gmail.com>
In-reply-to <1305832532.67.0.252255366596.issue12105@psf.upfronthosting.co.za>
Content
> Using spawn_python() to check that os.O_CLOEXEC flag is correctly set seems
> overkill. Why not just testing fcntl.fcntl(f.fileno(), fcntl.F_GETFL) &
> FD_CLOEXEC)?

Because I couldn't find a place where the CLOEXEC flag was fully
tested (I mean, checking in the child process that the FD was
correctly closed), so I took the opportunity to test it thoroughly
here.
But you're right it's maybe a little bit overkill, so here's a patch
using just F_GETFL. Pick up whichever you like.

>> Note that I'm not sure that adding this flag to built-in open()
>> is necessarily a good idea
>
> I agree.
>

OK.

> open() documentation may explain the os.fdopen(os.open()) "trick" to use
> low-level options like O_SYNC or O_CLOEXEC.
>

Why not, but I leave it to someone more comfortable with documentation
than me :-)
Files
File name Uploaded
os_cloexec_1.diff neologix, 2011-05-19.20:34:19
History
Date User Action Args
2011-05-19 20:34:20neologixsetrecipients: + neologix, amaury.forgeotdarc, vstinner, socketpair, alexey-smirnov
2011-05-19 20:34:19neologixlinkissue12105 messages
2011-05-19 20:34:19neologixcreate