From c85af79db11ed1d2f93261ea4069a23ff1709125 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Thu, 28 Mar 2013 20:05:13 +0100 Subject: [PATCH] Fix authentication with Python 3 (Issue #153) --- github/Requester.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/Requester.py b/github/Requester.py index c84d1656..7598e3f2 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -49,7 +49,7 @@ class Requester: if password is not None: login = login_or_token if atLeastPython3: - self.__authorizationHeader = "Basic " + str(base64.b64encode(bytearray(login + ":" + password, "utf-8"))).replace('\n', '') # pragma no cover + self.__authorizationHeader = "Basic " + base64.b64encode((login + ":" + password).encode("utf-8")).decode("utf-8").replace('\n', '') # pragma no cover else: self.__authorizationHeader = "Basic " + base64.b64encode(login + ":" + password).replace('\n', '') elif login_or_token is not None: