diff --git a/gunicorn/glogging.py b/gunicorn/glogging.py index d8241449..018e7eca 100644 --- a/gunicorn/glogging.py +++ b/gunicorn/glogging.py @@ -4,6 +4,7 @@ # See the NOTICE for more information. import base64 +import binascii import time import logging logging.Logger.manager.emittedNoHandlerWarning = 1 @@ -394,6 +395,9 @@ class Logger(object): except TypeError as exc: self.debug("Couldn't get username: %s", exc) return user + except binascii.Error as exc: + self.debug("Couldn't get username: %s", exc) + return user if len(auth) == 2: user = auth[0] return user