Reset the encoder (merely useful for proper BOM handling)
(position)
| 2487 | |
| 2488 | def seek(self, cookie, whence=0): |
| 2489 | def _reset_encoder(position): |
| 2490 | """Reset the encoder (merely useful for proper BOM handling)""" |
| 2491 | try: |
| 2492 | encoder = self._encoder or self._get_encoder() |
| 2493 | except LookupError: |
| 2494 | # Sometimes the encoder doesn't exist |
| 2495 | pass |
| 2496 | else: |
| 2497 | if position != 0: |
| 2498 | encoder.setstate(0) |
| 2499 | else: |
| 2500 | encoder.reset() |
| 2501 | |
| 2502 | if self.closed: |
| 2503 | raise ValueError("tell on closed file") |
nothing calls this directly
no test coverage detected