MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / get_bytes

Method get_bytes

tools/python-3.11.9-amd64/Lib/mailbox.py:793–800  ·  view source on GitHub ↗

Return a string representation or raise a KeyError.

(self, key, from_=False)

Source from the content-addressed store, hash-verified

791 self.get_bytes(key, from_)).as_string(unixfrom=from_)
792
793 def get_bytes(self, key, from_=False):
794 """Return a string representation or raise a KeyError."""
795 start, stop = self._lookup(key)
796 self._file.seek(start)
797 if not from_:
798 self._file.readline()
799 string = self._file.read(stop - self._file.tell())
800 return string.replace(linesep, b'\n')
801
802 def get_file(self, key, from_=False):
803 """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