Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(backport from r59260)
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index 45997cb..87b298e 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -1065,7 +1065,8 @@
self.closed = False
self.members = [] # list of members as TarInfo objects
self._loaded = False # flag if all members have been read
- self.offset = 0L # current position in the archive file
+ self.offset = self.fileobj.tell()
+ # current position in the archive file
self.inodes = {} # dictionary caching the inodes of
# archive members already added