Documentation
This part of the documentation is inaccurate:
- A platform-specific location:
- On Windows, the directories
C:\TEMP, C:\TMP, \TEMP, and \TMP, in that order
As you can see from the implementation, %USERPROFILE%\AppData\Local\Temp and %SYSTEMROOT%\Temp are checked before the rest of the already documented directories:
|
if _os.name == 'nt': |
|
dirlist.extend([ _os.path.expanduser(r'~\AppData\Local\Temp'), |
|
_os.path.expandvars(r'%SYSTEMROOT%\Temp'), |
|
r'c:\temp', r'c:\tmp', r'\temp', r'\tmp' ]) |
|
else: |
|
dirlist.extend([ '/tmp', '/var/tmp', '/usr/tmp' ]) |
This has been the behaviour since Python 3.6, as introduced by:
e5f41d2
Linked PRs
Documentation
This part of the documentation is inaccurate:
As you can see from the implementation,
%USERPROFILE%\AppData\Local\Tempand%SYSTEMROOT%\Tempare checked before the rest of the already documented directories:cpython/Lib/tempfile.py
Lines 169 to 174 in 3ece6b5
This has been the behaviour since Python 3.6, as introduced by:
e5f41d2
Linked PRs