also ignore binascii error when decoding the user in access log

This commit is contained in:
benoitc 2015-11-21 10:19:06 +01:00
parent 38261b5235
commit 45f008187b

View File

@ -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