Skip to content
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

Caching files directly in the user's home dir #358

Open
jonaslb opened this issue Jan 21, 2025 · 1 comment · May be fixed by #360
Open

Caching files directly in the user's home dir #358

jonaslb opened this issue Jan 21, 2025 · 1 comment · May be fixed by #360

Comments

@jonaslb
Copy link

jonaslb commented Jan 21, 2025

Describe the bug
Since 3.0 blosc2 has been dumping a json file to the user's home dir. I understand that this helps blosc start up faster. However, dumping files directly in the user's home dir is not really considered good form. Many users are annoyed by such littering of dotfiles.

On Linux, the XDG spec is a more-or-less accepted standard for where to put data (config, cache etc). There are other standards on Mac and Windows.
I would strongly suggest using a package such as platformdirs to select an appropriate location for cache files (and other files for that matter, if it becomes relevant).

Using that package (or just the xdg dirs), the cpuinfo cache file would be written to ${HOME}/.cache/python-blosc2/cpuinfo.json on Linux (unless the user has configured another cache dir on his system).

To Reproduce
Steps to reproduce the behavior:

  1. import blosc
  2. file is created in home dir

Expected behavior

Any cache is written into the appropriate cache dir.

Desktop (please complete the following information):

Linux, but the issue would apply on all platforms

@FrancescAlted
Copy link
Member

I think this is a good idea. Would you mind providing a PR?

@jonaslb jonaslb linked a pull request Feb 1, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants