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