spotipy-dev / spotipy

A light weight Python library for the Spotify Web API
http://spotipy.readthedocs.org
MIT License
5.05k stars 960 forks source link

rename '.cache' #712

Open 0xbrayo opened 3 years ago

0xbrayo commented 3 years ago

The .cache filename clashes with the .cache directory found on the linux '~/home' directory. Simply renaming the .cache file to something more unique would solve this problem. I would suggest renaming it to .sp_cache or something more descriptive like spotipy_cache file.

0xbrayo commented 3 years ago

if I get the green light I can open a PR and fix it by the weekend

stephanebruckert commented 3 years ago

As this is a backward-incompatible change, it would be fine for the v3 branch

See https://github.com/plamere/spotipy/issues/652

Peter-Schorn commented 3 years ago

It should also be noted that you can specify whatever cache path you want if the default conflicts with other files.

clemwo commented 2 years ago

It should also be noted that you can specify whatever cache path you want if the default conflicts with other files.

How do you do that?

Peter-Schorn commented 2 years ago

Since the last post on this thread, the API has changed somewhat. Here's how to specify the cache path—that is, the file in which the authorization information is stored—when creating an instance of Spotify:

spotify = Spotify(
    auth_manager=SpotifyOAuth(
        cache_handler=CacheFileHandler(cache_path="/path/to/cache")
    )
)