diff options
author | favll <favll@users.noreply.github.com> | 2017-08-01 18:12:26 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2017-08-01 18:12:26 (GMT) |
commit | adfe3440f65dfd6cf4463db6cd02cdc78e77ce17 (patch) | |
tree | 0387a80a252654820ebd92e1833023008092cce0 /Lib/logging | |
parent | 6f446bee4f6ac0c61bb2c3386a0149fd36855793 (diff) | |
download | cpython-adfe3440f65dfd6cf4463db6cd02cdc78e77ce17.zip cpython-adfe3440f65dfd6cf4463db6cd02cdc78e77ce17.tar.gz cpython-adfe3440f65dfd6cf4463db6cd02cdc78e77ce17.tar.bz2 |
bpo-31084: QueueHandler now formats messages correctly. (GH-2954)
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/handlers.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 2f934b3..b5fdfbc 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -1372,13 +1372,14 @@ class QueueHandler(logging.Handler): of the record while leaving the original intact. """ # The format operation gets traceback text into record.exc_text - # (if there's exception data), and also puts the message into - # record.message. We can then use this to replace the original + # (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. - self.format(record) - record.msg = record.message + msg = self.format(record) + record.message = msg + record.msg = msg record.args = None record.exc_info = None return record |