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

Method get_message

Lib/mailbox.py:840–849  ·  view source on GitHub ↗

Return a Message representation or raise a KeyError.

(self, key)

Source from the content-addressed store, hash-verified

838 _mangle_from_ = True
839
840 def get_message(self, key):
841 """Return a Message representation or raise a KeyError."""
842 start, stop = self._lookup(key)
843 self._file.seek(start)
844 from_line = self._file.readline().replace(linesep, b'').decode('ascii')
845 string = self._file.read(stop - self._file.tell())
846 msg = self._message_factory(string.replace(linesep, b'\n'))
847 msg.set_unixfrom(from_line)
848 msg.set_from(from_line[5:])
849 return msg
850
851 def get_string(self, key, from_=False):
852 """Return a string representation or raise a KeyError."""

Callers

nothing calls this directly

Calls 9

set_unixfromMethod · 0.80
set_fromMethod · 0.80
_lookupMethod · 0.45
seekMethod · 0.45
decodeMethod · 0.45
replaceMethod · 0.45
readlineMethod · 0.45
readMethod · 0.45
tellMethod · 0.45

Tested by

no test coverage detected