From a3a68be7bc1fd46133c5540073932611c4a3a409 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 22 Dec 2014 12:20:47 -0800 Subject: [PATCH] ascii decode in _refresh_access_token --- spotipy/oauth2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spotipy/oauth2.py b/spotipy/oauth2.py index bdcc0d8..7784354 100644 --- a/spotipy/oauth2.py +++ b/spotipy/oauth2.py @@ -218,8 +218,8 @@ class SpotifyOAuth(object): payload = { 'refresh_token': refresh_token, 'grant_type': 'refresh_token'} - auth_header = base64.b64encode(self.client_id + ':' + self.client_secret) - headers = {'Authorization': 'Basic %s' % auth_header} + auth_header = base64.b64encode(bytes(self.client_id + ':' + self.client_secret, encoding='utf-8')) + headers = {'Authorization': 'Basic %s' % auth_header.decode('ascii')} response = requests.post(self.OAUTH_TOKEN_URL, data=payload, headers=headers)