Skip to content

Commit d20758c

Browse files
authored
[3.11] gh-51574: Document behaviour of mkdtemp on 3.11 and lower (#103844)
1 parent 7f70f1c commit d20758c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Doc/library/tempfile.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,10 @@ The module defines the following user-callable items:
226226
The *prefix*, *suffix*, and *dir* arguments are the same as for
227227
:func:`mkstemp`.
228228

229-
:func:`mkdtemp` returns the absolute pathname of the new directory.
229+
:func:`mkdtemp` returns the absolute pathname of the new directory if *dir*
230+
is ``None`` or is an absolute path. If *dir* is a relative path,
231+
:func:`mkdtemp` returns a relative path on Python 3.11 and lower. However,
232+
on 3.12 it will return an absolute path in all situations.
230233

231234
.. audit-event:: tempfile.mkdtemp fullpath tempfile.mkdtemp
232235

0 commit comments

Comments
 (0)