[Python-checkins] r70530 - python/branches/release25-maint/Lib/tarfile.py

lars.gustaebel python-checkins at python.org
Sun Mar 22 22:34:05 CET 2009


Author: lars.gustaebel
Date: Sun Mar 22 22:34:05 2009
New Revision: 70530

Log:
Avoid EOFError being passed to the caller (restoring the
old behavior).


Modified:
   python/branches/release25-maint/Lib/tarfile.py

Modified: python/branches/release25-maint/Lib/tarfile.py
==============================================================================
--- python/branches/release25-maint/Lib/tarfile.py	(original)
+++ python/branches/release25-maint/Lib/tarfile.py	Sun Mar 22 22:34:05 2009
@@ -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)


More information about the Python-checkins mailing list