bpo-42369: Fix thread safety of zipfile._SharedFile.tell (GH-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.
K
Kevin Mehall committed
e730ae7effe4f13b24f1b5fb1fca005709c86acb
Parent: 3af68fc
Committed by GitHub <noreply@github.com>
on 3/20/2022, 2:26:09 PM