summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Gustäbel <lars@gustaebel.de>2009-03-22 21:34:05 +0000
committerLars Gustäbel <lars@gustaebel.de>2009-03-22 21:34:05 +0000
commit9734a3d31fba8ece6d3f3e2f9bbb2a8634dc676f (patch)
treeb950e7292baedc16766085f9d9aaeff14a429575
parent190010617e67cc8fe5a1ad9f2c22059965023d2f (diff)
downloadcpython-9734a3d31fba8ece6d3f3e2f9bbb2a8634dc676f.tar.gz
Avoid EOFError being passed to the caller (restoring the
old behavior).
-rw-r--r--Lib/tarfile.py5
1 files changed, 4 insertions, 1 deletions
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)