[Python-checkins] r70529 - python/branches/release30-maint/Lib/tarfile.py

lars.gustaebel python-checkins at python.org
Sun Mar 22 22:32:31 CET 2009


Author: lars.gustaebel
Date: Sun Mar 22 22:32:31 2009
New Revision: 70529

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


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

Modified: python/branches/release30-maint/Lib/tarfile.py
==============================================================================
--- python/branches/release30-maint/Lib/tarfile.py	(original)
+++ python/branches/release30-maint/Lib/tarfile.py	Sun Mar 22 22:32:31 2009
@@ -642,7 +642,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
             self.buf += data
             x += len(data)
 


More information about the Python-checkins mailing list