bpo-34334: Don't log traceback twice in QueueHandler (GH-9537)

This commit is contained in:
Cheryl Sabella 2018-09-25 19:00:08 -04:00 committed by Vinay Sajip
parent fad6af2744
commit d345bb4d9b
4 changed files with 23 additions and 5 deletions

View file

@ -1374,13 +1374,14 @@ class QueueHandler(logging.Handler):
# (if there's exception data), and also returns the formatted
# message. We can then use this to replace the original
# msg + args, as these might be unpickleable. We also zap the
# exc_info attribute, as it's no longer needed and, if not None,
# will typically not be pickleable.
# exc_info and exc_text attributes, as they are no longer
# needed and, if not None, will typically not be pickleable.
msg = self.format(record)
record.message = msg
record.msg = msg
record.args = None
record.exc_info = None
record.exc_text = None
return record
def emit(self, record):