Issue #1531: Read fileobj from the current offset, do not seek to
the start.
(will backport to 2.5)
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
index ee9922c..ae24291 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -1558,7 +1558,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