]> granicus.if.org Git - python/commitdiff
Avoid EOFError being passed to the caller (restoring the
authorLars Gustäbel <lars@gustaebel.de>
Sun, 22 Mar 2009 21:34:05 +0000 (21:34 +0000)
committerLars Gustäbel <lars@gustaebel.de>
Sun, 22 Mar 2009 21:34:05 +0000 (21:34 +0000)
old behavior).

Lib/tarfile.py

index 8b477fe76e79f1cca9322342680516d32a88f75d..aac6a5d48d68e44ef04ffadc3a76eed5966c0cf3 100644 (file)
@@ -597,7 +597,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
             b.append(data)
             x += len(data)
         self.buf = "".join(b)