Issue 25685: Inefficiency with SocketHandler - may send log record message string twice in pickled data structure (original) (raw)
In logging.handlers.SocketHandler.makePickle code was added for issue 14436 that replaces the 'msg' in the log record dict with the formatted message. But if an earlier handler already formatted the message, it will have been added to the log record with key 'message'. In this case the identical message will be sent across the wire twice in the pickled data.
The patch simply deletes the 'message' entry from the dict. More involved changes (like reusing record.message instead of calling getMessage) probably not useful.