New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENH]: move .matplotlib folder from %USERPROFILE% on Windows #20779
Comments
Do you have a reference for what "should" be in various places? I suspect that this would be addressed by #12549 , but if we do not want to pick up that dependency, the place in the code to make the change is matplotlib/lib/matplotlib/__init__.py Lines 470 to 478 in e291cdb
Even though this is an internal cache, we should document that we are moving it on windows (as I'm sure there exist other users who have discovered where it lives and are either deleting it (for reasons) or pre-populating it (again, for reasons). |
Milestoned for 3.6, but if it is ready it can go in for 3.5. Labeled good first issue because it only requires changing details of how we discover the cache directory and should not touch our public API (other than a sideeffect of where files go), but may require intermediate Python (as I think we want to generalize |
https://docs.microsoft.com/en-us/windows/apps/design/app-settings/store-and-retrieve-app-data |
Why not just use |
I think it should go into %LOCALAPPDATA%, not %APPDATA% which is for roaming app data. Cached fonts data are certainly not applicable on other devices. See also https://docs.microsoft.com/en-us/windows/win32/shell/knownfolderid. |
On Windows, the matplotlib/lib/matplotlib/__init__.py Lines 467 to 472 in c072e3a
On Windows, I think we need to differentiate between %APPDATA% for roaming config data (get_configdir) and %LOCALAPPDATA% for local cache data (get_cachedir). |
@StefRe I think it should go into %LOCALAPPDATA%, not %APPDATA% which is for roaming app data. appdirs already figures this out for you if you pass |
@NeilGirdhar Thanks for mentioning, but all I wanted to say was just what files should go to what folders, not how to obtain these folder locations. |
@tacaswell If we want to fix this particular issue #20779 for Windows, I can make a PR. |
@StefRe Yes, I understand, but if you're going to fix this, I really think using appdirs is the right approach. They have already tested to make sure that their folder choices are correct. Otherwise, you'll just be fixing it for one OS for now, and it could easily break again one day. More importantly, the folders are messed up on all operating systems for the rest of us. I also don't think it's that much harder to use appdirs than to do this manually. Just call |
@NeilGirdhar I didn't say that it's hard to use
I'd use |
You're right! Good point.
I understand. That's fair. But the issue with just hacking a custom solution is that it remains messed up for the rest of us :/ I didn't think about the documentation issue. |
Problem
The folder contains "fontlist-v330.json" in my case.
Proposed solution
Move the directory to a subdirectory in %APPDATA%, where it belongs (as the name suggests).
Additional context and prior art
No response
The text was updated successfully, but these errors were encountered: