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

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

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

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 9d26f47820b134..e18d8c18d5abd7 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]