From 45f008187b352a50425f662973888a38dd8e5bd8 Mon Sep 17 00:00:00 2001 From: benoitc Date: Sat, 21 Nov 2015 10:19:06 +0100 Subject: [PATCH] also ignore binascii error when decoding the user in access log --- gunicorn/glogging.py | 4 ++++ 1 file changed, 4 insertions(+) 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