(self, key)
| 142 | raise error('DBM object has already been closed') |
| 143 | |
| 144 | def __getitem__(self, key): |
| 145 | if isinstance(key, str): |
| 146 | key = key.encode('utf-8') |
| 147 | self._verify_open() |
| 148 | pos, siz = self._index[key] # may raise KeyError |
| 149 | with _io.open(self._datfile, 'rb') as f: |
| 150 | f.seek(pos) |
| 151 | dat = f.read(siz) |
| 152 | return dat |
| 153 | |
| 154 | # Append val to the data file, starting at a _BLOCKSIZE-aligned |
| 155 | # offset. The data file is first padded with NUL bytes (if needed) |
nothing calls this directly
no test coverage detected