diff --git a/spotipy/oauth2.py b/spotipy/oauth2.py index 1e637fb..d1b6211 100644 --- a/spotipy/oauth2.py +++ b/spotipy/oauth2.py @@ -185,8 +185,8 @@ class SpotifyOAuth(object): if self.state: payload['state'] = self.state - auth_header = base64.b64encode(self.client_id + ':' + self.client_secret) - headers = {'Authorization': 'Basic %s' % auth_header} + auth_header = base64.b64encode(str(self.client_id + ':' + self.client_secret).encode()) + headers = {'Authorization': 'Basic %s' % auth_header.decode()} response = requests.post(self.OAUTH_TOKEN_URL, data=payload,