From f19682cc803420b005c4ed4f3541577e6184f33a Mon Sep 17 00:00:00 2001 From: Joona Hoikkala Date: Fri, 5 Jun 2015 12:11:06 +0300 Subject: [PATCH] Fixed (byte)string handling when calling base64 lib --- spotipy/oauth2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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,