MCPcopy Create free account
hub / github.com/RustPython/RustPython / get_file

Method get_file

Lib/mailbox.py:1125–1134  ·  view source on GitHub ↗

Return a file-like representation or raise a KeyError.

(self, key)

Source from the content-addressed store, hash-verified

1123 _unlock_file(f)
1124
1125 def get_file(self, key):
1126 """Return a file-like representation or raise a KeyError."""
1127 try:
1128 f = open(os.path.join(self._path, str(key)), 'rb')
1129 except OSError as e:
1130 if e.errno == errno.ENOENT:
1131 raise KeyError('No message with key: %s' % key)
1132 else:
1133 raise
1134 return _ProxyFile(f)
1135
1136 def iterkeys(self):
1137 """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