Fixed (byte)string handling when calling base64 lib

This commit is contained in:
Joona Hoikkala 2015-06-05 12:11:06 +03:00
parent 1f833afa45
commit f19682cc80
1 changed files with 2 additions and 2 deletions

View File

@ -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,