commit | 4f908ddc884505763c24aba74a447b58385a52ad | [log] [tgz] |
---|---|---|
author | Lars Gustäbel <lars@gustaebel.de> | Sun Mar 22 21:29:48 2009 +0000 |
committer | Lars Gustäbel <lars@gustaebel.de> | Sun Mar 22 21:29:48 2009 +0000 |
tree | 9c960ccf937bbfcf480275ace036d78391b5cbdc | |
parent | 9e2a09a3a3b443dcf595513b04d4fdd261d03961 [diff] [blame] |
Avoid EOFError being passed to the caller (restoring the old behavior).
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 8e98dfa..508d88e 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py
@@ -665,7 +665,10 @@ 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)