From: Lars Gustäbel Date: Sun, 22 Mar 2009 21:34:05 +0000 (+0000) Subject: Avoid EOFError being passed to the caller (restoring the X-Git-Tag: v2.5.5c1~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b4dc921e30cd6c7735baaa49c6843dcd47ae7fd5;p=python Avoid EOFError being passed to the caller (restoring the old behavior). --- diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 8b477fe76e..aac6a5d48d 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -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)