You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
Default location should be user_cache_dir()/spotipy, .cache-spotipy, or whatever else, just not in conflict with a standard location.
This is a one liner fix and amounts to
if username:
...
else:
cache_path += '-spotipy'
A thorough solution would use platformdirs, but requires adding a dependency:
Note that also .cache is created with world read permissions, which is undesirable, as it contains secrets. Please use umask 0007 for sensitive files like this.
Describe the bug
Spotipy stores its cache under
.cache
. If running from a user's home directory, this conflicts with the XDG standard.https://github.com/spotipy-dev/spotipy/blob/d31969108d462c544f41aba4581a0d84a1e75d6f/spotipy/cache_handler.py#L67C1-L72
Your code
Expected behavior
Default location should be
user_cache_dir()/spotipy
,.cache-spotipy
, or whatever else, just not in conflict with a standard location.This is a one liner fix and amounts to
A thorough solution would use platformdirs, but requires adding a dependency:
Output
see above
Environment:
any XDG compliant linux
Additional context
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
see also #712
The text was updated successfully, but these errors were encountered: