[Python-Dev] PEP 433: second try

Hrvoje Niksic hrvoje.niksic at avl.com
Wed Jan 30 13:30:28 CET 2013


On 01/30/2013 01:00 PM, Victor Stinner wrote:
>> Disable inheritance by default
>> (...)
>> * It violates the principle of least surprise.  Developers using the
>>   os module may expect that Python respects the POSIX standard and so
>>   that close-on-exec flag is not set by default.
>
> Oh, I just saw that Perl is "violating POSIX" since Perl 1:
> close-on-exec flag in set on new created file descriptors if their
> number is greater than $SYSTEM_FD_MAX (which is usually 2).

I haven't checked the source, but I suspect this applies only to file 
descriptors opened with open(), not to explicit POSIX::* calls.  (The 
documentation of the latter doesn't mention close-on-exec at all.) 
Perl's open() contains functionality equivalent to Python's open() and 
subprocess.Popen(), the latter of which already closes on exec by default.



More information about the Python-Dev mailing list