{{ message }}
Repository navigation
FIX: interpolate the path and name MPLCONFIGDIR in the temp cache dir warning - #32252
Merged
Merged
Conversation
The warning announcing the fallback to a temporary cache directory lost its f-prefix when the message was refactored in matplotlib#30454, so it prints a literal "{configdir}". Restore the interpolation, and when MPLCONFIGDIR is set explicitly, name the variable instead of blaming "the default path" the user never touched. Strengthen test_tmpconfigdir_warning to assert that the resolved path appears in the warning; the strengthened test fails on the unfixed code.
rokokol
force-pushed
the
fix-mplconfigdir-warning
branch
from
August 28, 2026 10:57
282f76e to
6bd17d5
Compare
tacaswell
approved these changes
Aug 30, 2026
QuLogic
approved these changes
Aug 31, 2026
QuLogic
added a commit
that referenced
this pull request
Sep 1, 2026
…252-on-v3.11.x Backport PR #32252 on branch v3.11.x (FIX: interpolate the path and name MPLCONFIGDIR in the temp cache dir warning)
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.

PR summary
When Matplotlib falls back to a temporary cache directory, the warning has two problems (discussed in #32246):
{configdir}: the message text was refactored into theissue_msgvariable and lost itsfprefix on the way. The regression ships in releases since 3.11.0.MPLCONFIGDIRis set explicitly, the message still blames "the default path", pointing the reader away from the variable they set.This PR restores the interpolation and names
MPLCONFIGDIRin the message when it is the source of the path.test_tmpconfigdir_warningnow also asserts that the resolved path appears in the warning — the strengthened test fails against current main and passes with the fix.The behavioral half of #32246 (honoring a read-only cache dir) is left for a separate PR per the discussion there.
AI Disclosure
AI-assisted: I used Claude (Anthropic) to help analyze the code paths and draft the patch, tests and text. I reviewed and understand every change, and verified the behavior myself: the strengthened test fails against current main (it prints the literal
{configdir}) and passes with the fix.PR quality check