From 19e564a69b39d8c06fb5ecee8ee9264f2838e7ec Mon Sep 17 00:00:00 2001 From: Alexeev Nickolay Date: Thu, 11 Apr 2019 18:29:53 +0300 Subject: [PATCH] (fix) base64 for python 2/3 --- yandex_connect/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yandex_connect/base.py b/yandex_connect/base.py index 117dbc0..212d942 100644 --- a/yandex_connect/base.py +++ b/yandex_connect/base.py @@ -25,8 +25,9 @@ def token_get_by_code(): code = input('Enter code: ') auth = '%s:%s' % (client_id, client_secret) + auth_base64 = base64.encodestring(auth.encode()).decode("utf-8") headers = { - "Authorization": "Basic %s" % base64.b64encode(auth).replace('\n', '').strip() + "Authorization": "Basic %s" % auth_base64.replace('\n', '').strip() } r = requests.post( 'https://oauth.yandex.ru/token',