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

View File

@ -185,8 +185,8 @@ class SpotifyOAuth(object):
if self.state: if self.state:
payload['state'] = self.state payload['state'] = self.state
auth_header = base64.b64encode(self.client_id + ':' + self.client_secret) auth_header = base64.b64encode(str(self.client_id + ':' + self.client_secret).encode())
headers = {'Authorization': 'Basic %s' % auth_header} headers = {'Authorization': 'Basic %s' % auth_header.decode()}
response = requests.post(self.OAUTH_TOKEN_URL, data=payload, response = requests.post(self.OAUTH_TOKEN_URL, data=payload,