From 4f908ddc884505763c24aba74a447b58385a52ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gust=C3=A4bel?= Date: Sun, 22 Mar 2009 21:29:48 +0000 Subject: [PATCH] Avoid EOFError being passed to the caller (restoring the old behavior). --- Lib/tarfile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 8e98dfa5275..508d88ea20f 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -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)