(original) (raw)

Yes, but I'm not interested to write such doc.

Victor

Le 15 sept. 2013 10:34, "Georg Brandl" <g.brandl@gmx.net> a écrit :
On 08/28/2013 01:20 AM, victor.stinner wrote:
\> http://hg.python.org/cpython/rev/ef889c3d5dc6
\> changeset: 85420:ef889c3d5dc6
\> user: Victor Stinner <victor.stinner@gmail.com>
\> date: Wed Aug 28 00:53:59 2013 +0200
\> summary:
\> Issue #18571: Implementation of the PEP 446: file descriptors and file handles
\> are now created non-inheritable; add functions os.get/set\_inheritable(),
\> os.get/set\_handle\_inheritable() and socket.socket.get/set\_inheritable().

\> +.. \_fd\_inheritance:
\> +
\> +Inheritance of File Descriptors
\> +\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~\~
\> +
\> +A file descriptor has a inheritable flag which indicates if the file descriptor
\> +can be inherited or not in child processes. Since Python 3.4, file descriptors
\> +created by Python are non-inheritable by default.
\> +
\> +On UNIX, non-inheritable file descriptors are closed in child processes at the
\> +execution of a new program, other file descriptors are inherited.
\> +
\> +On Windows, non-inheritable handles and file descriptors are closed in child
\> +processes, except standard streams (file descriptors 0, 1 and 2: stdin, stdout
\> +and stderr) which are always inherited. Using :func:\`os.spawn\*\` functions,
\> +all inheritable handles and all inheritable file descriptors are inherited.
\> +Using the :mod:\`subprocess\` module, all file descriptors except standard
\> +streams are closed, inheritable handles are only inherited if the \*close\_fds\*
\> +parameter is \`\`False\`\`.
\> +
\> +.. versionadded:: 3.4
\> +
\> +.. function:: get\_inheritable(fd)
\> +
\> + Get the \`inheritable flag \`\_ of the specified file
\> + descriptor. Return a :class:\`bool\`.
\> +
\> +.. function:: set\_inheritable(fd, inheritable)
\> +
\> + Set the \`inheritable flag \`\_ of the specified file descriptor.
\> +
\> +.. function:: get\_handle\_inheritable(handle)
\> +
\> + Get the \`inheritable flag \`\_ of the specified handle. Return a :class:\`bool\`.
\> +
\> + Availability: Windows.
\> +
\> +.. function:: set\_handle\_inheritable(handle, inheritable)
\> +
\> + Set the \`inheritable flag \`\_ of the specified handle.
\> +
\> + Availability: Windows.
\> +

"Handle" is used nowhere else in the os module documentation. Do you think it
would make sense to have a brief paragraph on what are possible handles under
Windows (and that file descriptors aren't handles)?

Georg

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/victor.stinner%40gmail.com