[GH-ISSUE #654] Problems with recent changes to client.py #388

Closed
opened 2026-02-27 23:22:21 +03:00 by kerem · 4 comments
Owner

Originally created by @jrauvola on GitHub (Mar 5, 2021).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/654

Describe the bug
A clear and concise description of what the bug is.

I am developing an application that takes in user Spotify data. The change made a few days ago from method_whitelist to allowed_methods is throwing errors for some but not all of my group members

Your code
Share a complete minimal working example.

sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id='e2d254e0598f4ff49c5ce98717d35334',
client_secret='db0d037ea3fe46d4b62c205ce5208d63',
redirect_uri='http://localhost:8888/callback',
scope="user-library-read",
open_browser = False))

Expected behavior
A clear and concise description of what you expected to happen.

All I want is to gain access to the mock user account - so I should receive the typical output for this line of code as explained in the documentation

Output
Paste and format errors (with complete stacktrace) or logs. Make sure to remove sensitive information.


TypeError Traceback (most recent call last)
in ()
3 redirect_uri='http://localhost:8888/callback',
4 scope="user-library-read",
----> 5 open_browser = False))

1 frames
/usr/local/lib/python3.7/dist-packages/spotipy/client.py in _build_session(self)
198 status=self.status_retries,
199 backoff_factor=self.backoff_factor,
--> 200 status_forcelist=self.status_forcelist)
201
202 adapter = requests.adapters.HTTPAdapter(max_retries=retry)

TypeError: init() got an unexpected keyword argument 'allowed_methods'

Environment:

  • OS: [e.g. Windows, Mac]
  • Python version [e.g. 3.7.0]
  • spotipy version [e.g. 2.12.0]
  • your IDE (if using any) [e.g. PyCharm, Jupyter Notebook IDE, Google Colab]

Google Colab

Additional context
Add any other context about the problem here.

Originally created by @jrauvola on GitHub (Mar 5, 2021). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/654 **Describe the bug** A clear and concise description of what the bug is. I am developing an application that takes in user Spotify data. The change made a few days ago from method_whitelist to allowed_methods is throwing errors for some but not all of my group members **Your code** Share a complete minimal working example. sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id='e2d254e0598f4ff49c5ce98717d35334', client_secret='db0d037ea3fe46d4b62c205ce5208d63', redirect_uri='http://localhost:8888/callback', scope="user-library-read", open_browser = False)) **Expected behavior** A clear and concise description of what you expected to happen. All I want is to gain access to the mock user account - so I should receive the typical output for this line of code as explained in the documentation **Output** Paste and format errors (with complete stacktrace) or logs. Make sure to remove sensitive information. --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-26-a039bb6c9698> in <module>() 3 redirect_uri='http://localhost:8888/callback', 4 scope="user-library-read", ----> 5 open_browser = False)) 1 frames /usr/local/lib/python3.7/dist-packages/spotipy/client.py in _build_session(self) 198 status=self.status_retries, 199 backoff_factor=self.backoff_factor, --> 200 status_forcelist=self.status_forcelist) 201 202 adapter = requests.adapters.HTTPAdapter(max_retries=retry) TypeError: __init__() got an unexpected keyword argument 'allowed_methods' **Environment:** - OS: [e.g. Windows, Mac] - Python version [e.g. 3.7.0] - spotipy version [e.g. 2.12.0] - your IDE (if using any) [e.g. PyCharm, Jupyter Notebook IDE, Google Colab] Google Colab **Additional context** Add any other context about the problem here.
kerem 2026-02-27 23:22:21 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@stephanebruckert commented on GitHub (Mar 5, 2021):

Do you have spotipy 2.17.1?

pip list | grep spotipy
<!-- gh-comment-id:791616041 --> @stephanebruckert commented on GitHub (Mar 5, 2021): Do you have spotipy 2.17.1? pip list | grep spotipy
Author
Owner

@jrauvola commented on GitHub (Mar 5, 2021):

Yes I do

Command ran:

pip list | grep spotipy:

Output:

spotipy 2.17.1

<!-- gh-comment-id:791706690 --> @jrauvola commented on GitHub (Mar 5, 2021): Yes I do Command ran: pip list | grep spotipy: Output: spotipy 2.17.1
Author
Owner

@stephanebruckert commented on GitHub (Mar 6, 2021):

Strange, 2.17.1 aimed to fix that. Could you also please check the version you have for urllib3 and requests?

<!-- gh-comment-id:791891195 --> @stephanebruckert commented on GitHub (Mar 6, 2021): Strange, 2.17.1 aimed to fix that. Could you also please check the version you have for `urllib3` and `requests`?
Author
Owner

@jrauvola commented on GitHub (Mar 8, 2021):

Updated urllib3 & requests - works now - thank you for your time

<!-- gh-comment-id:792394538 --> @jrauvola commented on GitHub (Mar 8, 2021): Updated urllib3 & requests - works now - thank you for your time
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#388
No description provided.