Reset the encoder (merely useful for proper BOM handling)
(position)
| 2452 | |
| 2453 | def seek(self, cookie, whence=0): |
| 2454 | def _reset_encoder(position): |
| 2455 | """Reset the encoder (merely useful for proper BOM handling)""" |
| 2456 | try: |
| 2457 | encoder = self._encoder or self._get_encoder() |
| 2458 | except LookupError: |
| 2459 | # Sometimes the encoder doesn't exist |
| 2460 | pass |
| 2461 | else: |
| 2462 | if position != 0: |
| 2463 | encoder.setstate(0) |
| 2464 | else: |
| 2465 | encoder.reset() |
| 2466 | |
| 2467 | if self.closed: |
| 2468 | raise ValueError("tell on closed file") |
nothing calls this directly
no test coverage detected