diff --git a/.gitignore b/.gitignore index 3f2548ef..8b5c3e39 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,8 @@ ################################################################################ *.pyc +.eggs/ +.python-version /GithubCredentials.py /scripts/TwitterCredentials.py diff --git a/.travis.yml b/.travis.yml index 0550534c..db6c6d1f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: python python: -- '2.7' - '2.6' +- '2.7' - '3.2' - '3.3' - '3.4' diff --git a/github/MainClass.py b/github/MainClass.py index 024f0a46..b436bb95 100644 --- a/github/MainClass.py +++ b/github/MainClass.py @@ -633,12 +633,17 @@ class GithubIntegration(object): "exp": now + 60, "iss": self.integration_id } - return jwt.encode( + encrypted = jwt.encode( payload, key=self.private_key, algorithm="RS256" ) + if atLeastPython3: + encrypted = encrypted.decode('utf-8') + + return encrypted + def get_access_token(self, installation_id, user_id=None): """ Get an access token for the given installation id. @@ -689,4 +694,4 @@ class GithubIntegration(object): raise GithubException.GithubException( status=response.status, data=response_text - ) \ No newline at end of file + )