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

Method get_bytes

Lib/mailbox.py:856–863  ·  view source on GitHub ↗

Return a string representation or raise a KeyError.

(self, key, from_=False)

Source from the content-addressed store, hash-verified

854 self.get_bytes(key, from_)).as_string(unixfrom=from_)
855
856 def get_bytes(self, key, from_=False):
857 """Return a string representation or raise a KeyError."""
858 start, stop = self._lookup(key)
859 self._file.seek(start)
860 if not from_:
861 self._file.readline()
862 string = self._file.read(stop - self._file.tell())
863 return string.replace(linesep, b'\n')
864
865 def get_file(self, key, from_=False):
866 """Return a file-like representation or raise a KeyError."""

Callers 1

get_stringMethod · 0.95

Calls 6

_lookupMethod · 0.45
seekMethod · 0.45
readlineMethod · 0.45
readMethod · 0.45
tellMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected