diff -r cdc3837cb1fc Lib/tarfile.py --- a/Lib/tarfile.py Tue Dec 16 03:21:54 2014 -0500 +++ b/Lib/tarfile.py Tue Dec 16 20:08:14 2014 +0800 @@ -2245,8 +2245,12 @@ return m # Read the next block. - self.fileobj.seek(self.offset) tarinfo = None + try: + self.fileobj.seek(self.offset) + except StreamError as e: + return tarinfo + while True: try: tarinfo = self.tarinfo.fromtarfile(self)