[Python-Dev] Add "e" (close and exec) mode to open()

Victor Stinner victor.stinner at gmail.com
Tue Jan 8 17:40:28 CET 2013


2013/1/8 Benjamin Peterson <benjamin at python.org>:
> 2013/1/8 Victor Stinner <victor.stinner at gmail.com>:
>> 2013/1/8 Benjamin Peterson <benjamin at python.org>:
>>> Okay, fair enough, but I really would like it not to ever raise
>>> NotImplementedError. Then you would end up having different codepaths
>>> for various oses anyway.
>>
>> So what do you suggest?
>
> If the only systems it doesn't work on is ancient RedHat, that's probably okay.

What do you mean? NotIlmplementedError is acceptable if only rare
and/or old OS raise such issue?

> According to the following email, fcntl.FD_CLOEXEC was not available
> in Python 2.2 on Red Hat 7.3 (in 2003):
> http://communities.mentor.com/community/cs/archives/qmtest/msg00501.html

This issue looks like http://bugs.python.org/issue496171

So it looks like the problem was just that the constant was not
exposed properly whereas the OS supports the feature. I guess that
FD_CLOEXEC always worked on RedHat.

Victor


More information about the Python-Dev mailing list