From 94a64e83a7a70de02d052519987bc2f355d9a4a3 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Tue, 25 Apr 2023 11:11:32 -0600 Subject: [PATCH] [3.11] gh-51574: Document behaviour of `mkdtemp` on 3.11 and lower --- Doc/library/tempfile.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst index b7e604c1b70acb..c17ead1510e7ef 100644 --- a/Doc/library/tempfile.rst +++ b/Doc/library/tempfile.rst @@ -226,7 +226,10 @@ The module defines the following user-callable items: The *prefix*, *suffix*, and *dir* arguments are the same as for :func:`mkstemp`. - :func:`mkdtemp` returns the absolute pathname of the new directory. + :func:`mkdtemp` returns the absolute pathname of the new directory if *dir* + is ``None`` or is an absolute path. If *dir* is a relative path, + :func:`mkdtemp` returns a relative path on Python 3.11 and lower. However, + on 3.12 it will return an absolute path in all situations. .. audit-event:: tempfile.mkdtemp fullpath tempfile.mkdtemp