Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Doc/library/os.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1969,7 +1969,8 @@ can be inherited by 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.
execution of a new program, other file descriptors are inherited. Note that
non-inheritable file descriptors are still *inherited* by child process on :func:`os.fork`.

On Windows, non-inheritable handles and file descriptors are closed in child
processes, except for standard streams (file descriptors 0, 1 and 2: stdin, stdout
Expand Down
5 changes: 3 additions & 2 deletions Doc/library/tempfile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,9 @@ The module defines the following user-callable items:
properly implements the :const:`os.O_EXCL` flag for :func:`os.open`. The
file is readable and writable only by the creating user ID. If the
platform uses permission bits to indicate whether a file is executable,
the file is executable by no one. The file descriptor is not inherited
by child processes.
the file is executable by no one.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expected a simpler change, just add a link to FD inheritance:

(...) The file descriptor is :ref:`not inherited
by child processes <fd_inheritance>`.


The file descriptor is :ref:`not inherited by child processes <fd_inheritance>`.

Unlike :func:`TemporaryFile`, the user of :func:`mkstemp` is responsible
for deleting the temporary file when done with it.
Expand Down
Loading