Skip to content

Commit 60b9cf8

Browse files
sirosenpicnic-sven
andauthored
gh-94543: Improve tempfile.mkstemp documentation about cleanup (#154748)
Co-authored-by: picnic-sven <88426829+picnic-sven@users.noreply.github.com>
1 parent 4c00d85 commit 60b9cf8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Doc/library/tempfile.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ The module defines the following user-callable items:
257257
The file descriptor is :ref:`not inherited by child processes <fd_inheritance>`.
258258

259259
Unlike :func:`TemporaryFile`, the user of :func:`mkstemp` is responsible
260-
for deleting the temporary file when done with it.
260+
for closing the file descriptor (for example, using :func:`os.close`) and
261+
deleting the temporary file (for example, using :func:`os.remove`).
261262

262263
If *suffix* is not ``None``, the file name will end with that suffix,
263264
otherwise there will be no suffix. :func:`mkstemp` does not put a dot

0 commit comments

Comments
 (0)