--- /usr/local/cpython-2.7/lib/python2.7/tarfile.py 2010-08-02 19:16:04.052791439 -0700 +++ tarfile.py 2010-11-07 20:03:06.882228669 -0800 @@ -1810,7 +1810,7 @@ """ return [tarinfo.name for tarinfo in self.getmembers()] - def gettarinfo(self, name=None, arcname=None, fileobj=None): + def gettarinfo(self, name=None, arcname=None, fileobj=None, statobj=None): """Create a TarInfo object for either the file `name' or the file object `fileobj' (using os.fstat on its file descriptor). You can modify some of the TarInfo's attributes before you add it using @@ -1840,7 +1840,9 @@ # Use os.stat or os.lstat, depending on platform # and if symlinks shall be resolved. - if fileobj is None: + if statobj is not None: + statres = statobj + elif fileobj is None: if hasattr(os, "lstat") and not self.dereference: statres = os.lstat(name) else: