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

Method _open_mh_sequences_file

Lib/mailbox.py:1156–1168  ·  view source on GitHub ↗
(self, text)

Source from the content-addressed store, hash-verified

1154 return len(list(self.iterkeys()))
1155
1156 def _open_mh_sequences_file(self, text):
1157 mode = '' if text else 'b'
1158 kwargs = {'encoding': 'ASCII'} if text else {}
1159 path = os.path.join(self._path, '.mh_sequences')
1160 while True:
1161 try:
1162 return open(path, 'r+' + mode, **kwargs)
1163 except FileNotFoundError:
1164 pass
1165 try:
1166 return open(path, 'x+' + mode, **kwargs)
1167 except FileExistsError:
1168 pass
1169
1170 def lock(self):
1171 """Lock the mailbox."""

Callers 2

lockMethod · 0.95
set_sequencesMethod · 0.95

Calls 2

openFunction · 0.70
joinMethod · 0.45

Tested by

no test coverage detected