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

Method get_file

Lib/mailbox.py:1132–1141  ·  view source on GitHub ↗

Return a file-like representation or raise a KeyError.

(self, key)

Source from the content-addressed store, hash-verified

1130 _unlock_file(f)
1131
1132 def get_file(self, key):
1133 """Return a file-like representation or raise a KeyError."""
1134 try:
1135 f = open(os.path.join(self._path, str(key)), 'rb')
1136 except OSError as e:
1137 if e.errno == errno.ENOENT:
1138 raise KeyError('No message with key: %s' % key)
1139 else:
1140 raise
1141 return _ProxyFile(f)
1142
1143 def iterkeys(self):
1144 """Return an iterator over keys."""

Callers

nothing calls this directly

Calls 4

strFunction · 0.85
_ProxyFileClass · 0.85
openFunction · 0.70
joinMethod · 0.45

Tested by

no test coverage detected