]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Avoid EOFError being passed to the caller (restoring the
authorLars Gustäbel <lars@gustaebel.de>
Sun, 22 Mar 2009 21:32:31 +0000 (21:32 +0000)
committerLars Gustäbel <lars@gustaebel.de>
Sun, 22 Mar 2009 21:32:31 +0000 (21:32 +0000)
old behavior).

Lib/tarfile.py

index dabf64a4316d09a7923a0c5fd054bc281759f068..4e649f66e3166d7f105d62dbc6ee0d2572efe705 100644 (file)
@@ -642,7 +642,10 @@ class _BZ2Proxy(object):
             raw = self.fileobj.read(self.blocksize)
             if not raw:
                 break
-            data = self.bz2obj.decompress(raw)
+            try:
+                data = self.bz2obj.decompress(raw)
+            except EOFError:
+                break
             self.buf += data
             x += len(data)