Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bpo-42369: Fix thread safety of zipfile._SharedFile.tell (pythonGH-26974
) The `_SharedFile` tracks its own virtual position into the file as `self._pos` and updates it after reading or seeking. `tell()` should return this position instead of calling into the underlying file object, since if multiple `_SharedFile` instances are being used concurrently on the same file, another one may have moved the real file position. Additionally, calling into the underlying `tell` may expose thread safety issues in the underlying file object because it was called without taking the lock.
- Loading branch information