]> 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:29:48 +0000 (21:29 +0000)
committerLars Gustäbel <lars@gustaebel.de>
Sun, 22 Mar 2009 21:29:48 +0000 (21:29 +0000)
old behavior).

Lib/tarfile.py

index 8e98dfa52758b77afb35ae5de264b59116510076..508d88ea20f88f843289f4933322857e2040e3f1 100644 (file)
@@ -665,7 +665,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)