PEP 433: add command line option and environment variable
This commit is contained in:
parent
039fc5d9da
commit
c4b34e2827
16
pep-0433.txt
16
pep-0433.txt
|
@ -329,20 +329,20 @@ the whole application including all modules and the Python standard
|
|||
library. This alternative is based on the `Proposal`_ and adds extra
|
||||
changes.
|
||||
|
||||
Add new functions:
|
||||
New functions, command line argument and environment variable:
|
||||
|
||||
* ``sys.getdefaultcloexec() -> bool``: get the default value of the
|
||||
close-on-exec flag for new file descriptor
|
||||
* ``sys.setdefaultcloexec(cloexec: bool)``: enable or disable
|
||||
close-on-exec flag, the state of the flag can be overriden in each
|
||||
function creating a file descriptor
|
||||
*cloexec* parameter
|
||||
* ``sys.setdefaultcloexec()``, ``-e`` command line option, ``PYTHONCLOEXEC``
|
||||
environment variable (if set): set the default value of the *cloexec*
|
||||
parameter to ``True``
|
||||
|
||||
The major change is that the default value of the ``cloexec`` parameter
|
||||
is ``sys.getdefaultcloexec()``, instead of ``False``.
|
||||
|
||||
When ``sys.setdefaultcloexec(True)`` is called to set close-on-exec by
|
||||
default, we have the same drawbacks as the
|
||||
`Enable file descriptor inheritance by default`_ alternative.
|
||||
When ``sys.setdefaultcloexec()`` is called to set close-on-exec by default, we
|
||||
have the same drawbacks as the `Enable file descriptor inheritance by default`_
|
||||
alternative.
|
||||
|
||||
There are additionnal drawbacks of having two behaviours depending on
|
||||
``sys.getdefaultcloexec()`` value:
|
||||
|
|
Loading…
Reference in New Issue