From 6cec23ba1ae4b92fdd30cef3bcc0cb8a69bc7a5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Arnauts?= Date: Thu, 2 Apr 2020 20:45:52 +0200 Subject: [PATCH] Fix token encoding --- resources/lib/viervijfzes/auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/lib/viervijfzes/auth.py b/resources/lib/viervijfzes/auth.py index 61365a1..b7651b6 100644 --- a/resources/lib/viervijfzes/auth.py +++ b/resources/lib/viervijfzes/auth.py @@ -33,7 +33,7 @@ class AuthApi: # Load tokens from cache try: - with open(self._token_path + self.TOKEN_FILE, 'rb') as fdesc: + with open(self._token_path + self.TOKEN_FILE, 'r') as fdesc: data_json = json.loads(fdesc.read()) self._id_token = data_json.get('id_token') self._refresh_token = data_json.get('refresh_token') @@ -75,7 +75,7 @@ class AuthApi: # Store new tokens in cache if not os.path.exists(self._token_path): os.mkdir(self._token_path) - with open(self._token_path + self.TOKEN_FILE, 'wb') as fdesc: + with open(self._token_path + self.TOKEN_FILE, 'w') as fdesc: data = json.dumps(dict( id_token=self._id_token, refresh_token=self._refresh_token,