MCPcopy Index your code
hub / github.com/python/cpython / makePickle

Method makePickle

Lib/logging/handlers.py:649–669  ·  view source on GitHub ↗

Pickles the record in binary format with a length prefix, and returns it ready for transmission across the socket.

(self, record)

Source from the content-addressed store, hash-verified

647 self.sock = None # so we can call createSocket next time
648
649 def makePickle(self, record):
650 """
651 Pickles the record in binary format with a length prefix, and
652 returns it ready for transmission across the socket.
653 """
654 ei = record.exc_info
655 if ei:
656 # just to get traceback text into record.exc_text ...
657 dummy = self.format(record)
658 # See issue #14436: If msg or args are objects, they may not be
659 # available on the receiving end. So we convert the msg % args
660 # to a string, save it as msg and zap the args.
661 d = dict(record.__dict__)
662 d['msg'] = record.getMessage()
663 d['args'] = None
664 d['exc_info'] = None
665 # Issue #25685: delete 'message' if present: redundant with 'msg'
666 d.pop('message', None)
667 s = pickle.dumps(d, 1)
668 slen = struct.pack(">L", len(s))
669 return slen + s
670
671 def handleError(self, record):
672 """

Callers 1

emitMethod · 0.95

Calls 5

formatMethod · 0.45
getMessageMethod · 0.45
popMethod · 0.45
dumpsMethod · 0.45
packMethod · 0.45

Tested by

no test coverage detected