Reset the encoder (merely useful for proper BOM handling)
(position)
| 2511 | |
| 2512 | def seek(self, cookie, whence=0): |
| 2513 | def _reset_encoder(position): |
| 2514 | """Reset the encoder (merely useful for proper BOM handling)""" |
| 2515 | try: |
| 2516 | encoder = self._encoder or self._get_encoder() |
| 2517 | except LookupError: |
| 2518 | # Sometimes the encoder doesn't exist |
| 2519 | pass |
| 2520 | else: |
| 2521 | if position != 0: |
| 2522 | encoder.setstate(0) |
| 2523 | else: |
| 2524 | encoder.reset() |
| 2525 | |
| 2526 | if self.closed: |
| 2527 | raise ValueError("tell on closed file") |
nothing calls this directly
no test coverage detected