[GH-ISSUE #163] Clearing Cache for util.prompt_for_user_token( ) #81

Closed
opened 2026-02-27 23:20:44 +03:00 by kerem · 2 comments
Owner

Originally created by @rymc9384 on GitHub (Feb 16, 2017).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/163

TL;DR: If you could have the util.prompt_for_user_token() function -- or the spotipy.Spotify(auth=token) function clear the cache created for authorization, that would be super helpful. Either removing the file entirely or being able to write over it w/o appending should work.

Longer Version:
I ran into an issue with getting the authorization to work, even though it had worked last night.
I was getting an error from the scope argument about not being able to split a None type, even when scope was set as a string. The error came from the _is_scope_subset() function in SpotifyOauth class.

I realized that the cache from last night was still there, and upon removing it my code magically worked again. Suggested fix is discussed above in the TL;DR section.

Thanks for all your work!

Originally created by @rymc9384 on GitHub (Feb 16, 2017). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/163 **TL;DR:** If you could have the ``util.prompt_for_user_token() `` function -- or the ``spotipy.Spotify(auth=token)`` function clear the cache created for authorization, that would be super helpful. Either removing the file entirely or being able to write over it w/o appending should work. **Longer Version:** I ran into an issue with getting the authorization to work, even though it had worked last night. I was getting an error from the *scope* argument about not being able to split a *None* type, even when *scope* was set as a string. The error came from the ``_is_scope_subset()`` function in **SpotifyOauth** class. I realized that the cache from last night was still there, and upon removing it my code magically worked again. Suggested fix is discussed above in the **TL;DR** section. Thanks for all your work!
kerem 2026-02-27 23:20:44 +03:00
Author
Owner

@jonascj commented on GitHub (Mar 31, 2017):

For anyone else wondering where this cache file is its alongside your python script called .cache-username, i.e. it is hidden on Linux. I missed it because I only did ls -l while looking for it.

<!-- gh-comment-id:290771655 --> @jonascj commented on GitHub (Mar 31, 2017): For anyone else wondering where this cache file is its alongside your python script called `.cache-username`, i.e. it is hidden on Linux. I missed it because I only did `ls -l` while looking for it.
Author
Owner

@stephanebruckert commented on GitHub (Jun 26, 2021):

Closing as wontfix as util.prompt_for_user_token() will be removed in v3

<!-- gh-comment-id:869059674 --> @stephanebruckert commented on GitHub (Jun 26, 2021): Closing as wontfix as `util.prompt_for_user_token()` will be removed in v3
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#81
No description provided.