gh-151138: Document Windows-specific temp dirs in gettempdir() - #156016
Closed
maksimtech wants to merge 3 commits into
Closed
gh-151138: Document Windows-specific temp dirs in gettempdir()#156016maksimtech wants to merge 3 commits into
maksimtech wants to merge 3 commits into
Conversation
Add %USERPROFILE%\AppData\Local\Temp and %SYSTEMROOT%\Temp to the documented Windows directory search order for gettempdir(). These directories have been checked since Python 3.6 (commit e5f41d2) but were missing from the documentation. Also add a versionchanged note for 3.6 to indicate when this behavior was introduced.
maksimtech
force-pushed
the
fix/tempfile-windows-docs
branch
from
August 18, 2026 13:31
43e99fd to
18f1503
Compare
Documentation build overview
|
Member
|
Hi @maksimtech, thanks for your contribution. However, there's already an active PR for this issue: #151210. In the future, please check for existing PRs before opening a new one. |
Author
|
Thanks for the heads up and for closing it! I checked the linked PRs I'll follow that PR and help if I can. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
tempfile.gettempdir()documentation incorrectly states that on Windows,only
C:\TEMP,C:\TMP,\TEMP, and\TMPare checked.Fix
Since Python 3.6 (commit e5f41d2), the implementation also checks:
%USERPROFILE%\AppData\Local\Temp%SYSTEMROOT%\TempThese are checked before the hardcoded paths but were missing from the docs.
This PR:
versionchanged:: 3.6note to document when this was introducedTesting
Documentation-only change. Verified with
make html— build succeeded with no errors.Fixes gh-151138