A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-January/123691.html below:

Choose the default value of the new cloexec parameter

[Python-Dev] PEP 433: Choose the default value of the new cloexec parameterNick Coghlan ncoghlan at gmail.com
Fri Jan 25 13:07:46 CET 2013
On Fri, Jan 25, 2013 at 9:36 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> Le Fri, 25 Jan 2013 12:28:10 +0100,
> Victor Stinner <victor.stinner at gmail.com> a écrit :
>> > I think the default behaviour needs to be configurable from the
>> > environment and the command line, but I don't believe it should be
>> > configurable from within the interpreter.
>>
>> sys.setdefaultcloexec() is convinient for unit test, but it may also
>> be used by modules. A web framework may want to enable close-on-exec
>> flag by default.
>>
>> The drawback of changing the default value after Python started is
>> that Python may have created file descriptors before, so you cannot
>> guarantee that all existing file descriptors have the flag set.
>>
>> Well, I don't know if sys.setdefaultcloexec() is a good idea or
>> not :-)
>
> Both Charles-François and Nick have good points.
> sys.setdefaultcloexec() is still useful if you want to force the
> policy from a Python script's toplevel (it's more practical than
> trying to fit a command-line option in the shebang line).

Right, I'm only -0 on that aspect. It strikes me as somewhat dubious,
but it's not obviously wrong the way a runtime equivalent of -Q or -R
would be.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4