[PR #44] [CLOSED] Python 3 compat and per-request oauth state #738

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

📋 Pull Request Information

Original PR: https://github.com/spotipy-dev/spotipy/pull/44
Author: @mbirtwell
Created: 3/14/2015
Status: Closed

Base: masterHead: master


📝 Commits (3)

  • 6172a0e Python 3 compat and per-request oauth state
  • 573c600 Remove debugging code
  • a8d0fc5 Make a couple of utility methods public: 'cos

📊 Changes

3 files changed (+34 additions, -30 deletions)

View changed files

📝 requirements.txt (+2 -1)
📝 spotipy/__init__.py (+1 -1)
📝 spotipy/oauth2.py (+31 -28)

📄 Description

Fixes for python 3:

  • Absolute imports in spotipy.init
  • use six to find urlencode
  • pass client_id/client_secret in post body instead of header during get_access_token.
    A bit of a cop-out I don't really understand why it wasn't working as a header.
    There was something strange happening with the unicode encoding I thought I fixed that
    but then I just kept getting invalid client errors back from spotify. Putting it in the body worked
    first time though

I've kind of mixed in with this making state a parameter of get_authorize_url and removing state and scope
from get_access_token - I feel bad this should really be another commit.
These parameters aren't required get_access_token according to the spotify docs and what do you know it works
with out.
I also think that it's quite useful if it's convenient to specify the state in the get_authorize_url function
this is mostly because I'm using that to stash a next page url.


🔄 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/44 **Author:** [@mbirtwell](https://github.com/mbirtwell) **Created:** 3/14/2015 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (3) - [`6172a0e`](https://github.com/spotipy-dev/spotipy/commit/6172a0ea1ec4d663f60aec82a74fe29f129d4da4) Python 3 compat and per-request oauth state - [`573c600`](https://github.com/spotipy-dev/spotipy/commit/573c6004bb06079cc41a2f8aca96baa8776aaeed) Remove debugging code - [`a8d0fc5`](https://github.com/spotipy-dev/spotipy/commit/a8d0fc5be685471ed23eafeb7773105ef9ce7508) Make a couple of utility methods public: 'cos ### 📊 Changes **3 files changed** (+34 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `requirements.txt` (+2 -1) 📝 `spotipy/__init__.py` (+1 -1) 📝 `spotipy/oauth2.py` (+31 -28) </details> ### 📄 Description Fixes for python 3: - Absolute imports in spotipy.**init** - use six to find urlencode - pass client_id/client_secret in post body instead of header during get_access_token. A bit of a cop-out I don't really understand why it wasn't working as a header. There was something strange happening with the unicode encoding I thought I fixed that but then I just kept getting invalid client errors back from spotify. Putting it in the body worked first time though I've kind of mixed in with this making state a parameter of get_authorize_url and removing state and scope from get_access_token - I feel bad this should really be another commit. These parameters aren't required get_access_token according to the spotify docs and what do you know it works with out. I also think that it's quite useful if it's convenient to specify the state in the get_authorize_url function this is mostly because I'm using that to stash a next page url. --- <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:26 +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#738
No description provided.