From a5d7827fc73852867cedf7b183f476f0ec9af0d4 Mon Sep 17 00:00:00 2001 From: Ben Hagen Date: Mon, 8 Oct 2018 15:47:13 +0200 Subject: [PATCH] Fix basic_auth with Python 3 `base64.b64decode` returns bytes and thus the separator needs to be a bytes-like object. --- gluon/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gluon/tools.py b/gluon/tools.py index 8eb2dc02..0e5c5fac 100644 --- a/gluon/tools.py +++ b/gluon/tools.py @@ -2252,7 +2252,7 @@ class Auth(AuthAPI): if basic_auth_realm: raise http_401 return (True, False, False) - (username, sep, password) = base64.b64decode(basic[6:]).partition(':') + (username, sep, password) = base64.b64decode(basic[6:]).partition(b':') is_valid_user = sep and self.login_bare(username, password) if not is_valid_user and basic_auth_realm: raise http_401