mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 16:45:52 +03:00
[GH-ISSUE #1021] .cache is an illegal location for a cache file and in conflict with the XDG standard #606
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#606
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @sigma67 on GitHub (Aug 20, 2023).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/1021
Describe the bug
Spotipy stores its cache under
.cache. If running from a user's home directory, this conflicts with the XDG standard.github.com/spotipy-dev/spotipy@d31969108d/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
@sijanec commented on GitHub (Sep 20, 2024):
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.
@stephanebruckert commented on GitHub (May 19, 2025):
Closing as it is a duplicate of https://github.com/spotipy-dev/spotipy/issues/712
Regarding that, it was fixed as part of https://github.com/spotipy-dev/spotipy/security/advisories/GHSA-pwhh-q4h6-w599
@sigma67 commented on GitHub (May 20, 2025):
@stephanebruckert thanks! If this was fixed as you say (where?), why is the duplicate you linked still open?
@stephanebruckert commented on GitHub (May 20, 2025):
Only the second part was fixed
github.com/spotipy-dev/spotipy@1ca453f6ef, the first part is still a duplicate and open!