Commit 4a14b44f authored by Guillaume Risbourg's avatar Guillaume Risbourg Committed by Vincent A

[myedenred] Fix python 3 compatibility

parent 4a733e79
......@@ -48,13 +48,13 @@ class MyedenredBrowser(LoginBrowser):
app_js = URL(r'https://myedenred.fr/js/app.(?P<random_str>\w+).js', JsAppPage)
def _b64encode(self, value):
return b64encode(value).replace('+', '-').replace('/', '_').replace('=', '')
return b64encode(value).decode('utf-8').replace('+', '-').replace('/', '_').replace('=', '')
def get_code_verifier(self):
return self._b64encode(''.join([str(randint(0, 9)) for _ in range(32)]))
return self._b64encode(''.join([str(randint(0, 9)) for _ in range(32)]).encode('utf-8'))
def get_code_challenge(self, verifier):
return self._b64encode(sha256(verifier).digest())
return self._b64encode(sha256(verifier.encode('utf-8')).digest())
def do_login(self):
self.home.go()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment