[3.14] gh-94543: Improve tempfile.mkstemp documentation about cleanup (GH-154748) (#154963)

hugovk <[email protected]> Thu, 30 Jul 2026 16:51:47 -0400 (EDT)
Newsgroups gmane.comp.python.cvs
Message-ID <[email protected]>
https://github.com/python/cpython/commit/91abbe6fda91632cab5f47a383445eecc4da619e
commit: 91abbe6fda91632cab5f47a383445eecc4da619e
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: hugovk <[email protected]>
date: 2026-07-30T20:51:35Z
summary:

[3.14] gh-94543: Improve tempfile.mkstemp documentation about cleanup (GH-154748) (#154963)

Co-authored-by: Stephen Rosen <[email protected]>
Co-authored-by: picnic-sven <[email protected]>

files:
M Doc/library/tempfile.rst

diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst
index 78d37d8135cc51..bd8df44618ad79 100644
--- a/Doc/library/tempfile.rst
+++ b/Doc/library/tempfile.rst
@@ -230,7 +230,8 @@ The module defines the following user-callable items:
    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.
+   for closing the file descriptor (for example, using :func:`os.close`) and
+   deleting the temporary file (for example, using :func:`os.remove`).
 
    If *suffix* is not ``None``, the file name will end with that suffix,
    otherwise there will be no suffix.  :func:`mkstemp` does not put a dot

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]