Skip to content

Commit 8ecbaa7

Browse files
committed
Clarify fd inheritance behavior for fork vs exec
Update mkstemp() documentation to clarify that file descriptors are not inherited across exec() calls but remain accessible after fork(). Add reference link to the fd_inheritance section. Also update the fd_inheritance section in os.rst to explicitly explain the distinction between fork() and exec() behavior for non-inheritable file descriptors. Addresses feedback from vstinner.
1 parent 000e800 commit 8ecbaa7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Doc/library/tempfile.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,8 @@ The module defines the following user-callable items:
230230
The file descriptor is not inherited by child processes across
231231
:func:`exec <os.execl>` calls, but will be inherited by child
232232
processes created via :func:`os.fork`. See
233-
`File Descriptor Inheritance <https://docs.python.org/dev/library/os.html#fd-inheritance>`_
234-
for more information.
235-
233+
:ref:`fd_inheritance` for more information.
234+
236235
Unlike :func:`TemporaryFile`, the user of :func:`mkstemp` is responsible
237236
for deleting the temporary file when done with it.
238237

0 commit comments

Comments
 (0)