[PR #169] [MERGED] Add cache_path as an argument to prompt_for_user_token() #800

Closed
opened 2026-02-28 00:01:47 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/spotipy-dev/spotipy/pull/169
Author: @jessejoe
Created: 3/8/2017
Status: Merged
Merged: 9/17/2017
Merged by: @plamere

Base: masterHead: add_cache_path_param


📝 Commits (1)

  • 403ab1c Add cache_path as an argument to prompt_for_user_token()

📊 Changes

1 file changed (+4 additions, -2 deletions)

View changed files

📝 spotipy/util.py (+4 -2)

📄 Description

Fixes #167

This allows overriding the default relative location of cache_path when calling prompt_for_user_token(). External scripts will be able to avoid creating a .cache-username file in whatever directory the user happens to be in when the script is ran.

I personally think cache_path should default to os.path.join(os.path.expanduser('~'), '.cache-' + username) so cache_path always references the same file in the user's $HOME, but that would probably break a lot of existing users.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/spotipy-dev/spotipy/pull/169 **Author:** [@jessejoe](https://github.com/jessejoe) **Created:** 3/8/2017 **Status:** ✅ Merged **Merged:** 9/17/2017 **Merged by:** [@plamere](https://github.com/plamere) **Base:** `master` ← **Head:** `add_cache_path_param` --- ### 📝 Commits (1) - [`403ab1c`](https://github.com/spotipy-dev/spotipy/commit/403ab1cfa16fc4ad1955f39147bc8e2920710b5f) Add cache_path as an argument to prompt_for_user_token() ### 📊 Changes **1 file changed** (+4 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `spotipy/util.py` (+4 -2) </details> ### 📄 Description Fixes #167 This allows overriding the default relative location of `cache_path` when calling `prompt_for_user_token()`. External scripts will be able to avoid creating a `.cache-username` file in whatever directory the user happens to be in when the script is ran. I personally think `cache_path` should default to `os.path.join(os.path.expanduser('~'), '.cache-' + username)` so `cache_path` always references the same file in the user's `$HOME`, but that would probably break a lot of existing users. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:01:47 +03:00
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#800
No description provided.