[yum-commits] yum/misc.py

zpavlas at osuosl.org zpavlas at osuosl.org
Wed Aug 29 15:28:28 UTC 2012


 yum/misc.py |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 25804df00f2f106528887cbd646ad68bfbd45e22
Author: Zdeněk Pavlas <zpavlas at redhat.com>
Date:   Wed Aug 29 14:45:39 2012 +0200

    Report empty/invalid BZ2/GZ files.
    
    Aborted downloads result in empty/incomplete .bz2 files.
    When we "uncompress" this to empty .sqlite, unrealated
    sql errors pop up.

diff --git a/yum/misc.py b/yum/misc.py
index 4cae42b..a39a222 100644
--- a/yum/misc.py
+++ b/yum/misc.py
@@ -759,10 +759,9 @@ def _decompress_chunked(source, dest, ztype):
     while True:
         try:
             data = s_fn.read(1024000)
-        except IOError:
-            break
-        except EOFError:
-            break
+        except (OSError, IOError, EOFError), e:
+            msg = "Error reading from file %s: %s" % (source, str(e))
+            raise Errors.MiscError, msg
         
         if not data: break
 


More information about the Yum-commits mailing list