commit | b4dc921e30cd6c7735baaa49c6843dcd47ae7fd5 | [log] [tgz] |
---|---|---|
author | Lars Gustäbel <lars@gustaebel.de> | Sun Mar 22 21:34:05 2009 +0000 |
committer | Lars Gustäbel <lars@gustaebel.de> | Sun Mar 22 21:34:05 2009 +0000 |
tree | 55c551cec95b675b1c7c788a4fd8c156165a4851 | |
parent | 7623294cb76b23d63df2858df71072721bf409cc [diff] [blame] |
Avoid EOFError being passed to the caller (restoring the old behavior).
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 8b477fe..aac6a5d 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py
@@ -597,7 +597,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)