yifengyou / rpms / yum

Forked from rpms/yum 3 years ago
Clone

Blame SOURCES/BZ-1058297-remove-del-for-weird-anaconda-C-NULL-exception.patch

5e9bef
commit 4ec4888593f739328600d42c1ad5a33d6b72674a
5e9bef
Author: Vratislav Podzimek <vpodzime@redhat.com>
5e9bef
Date:   Tue Apr 8 09:37:01 2014 -0400
5e9bef
5e9bef
    Remove extra del(fo) for weird C NULL execption (it is valid). BZ 1058297.
5e9bef
5e9bef
diff --git a/yum/misc.py b/yum/misc.py
5e9bef
index 347a07a..cdc08a0 100644
5e9bef
--- a/yum/misc.py
5e9bef
+++ b/yum/misc.py
5e9bef
@@ -360,7 +360,6 @@ def checksum(sumtype, file, CHUNK=2**16, datasize=None):
5e9bef
 
5e9bef
         if type(file) is types.StringType:
5e9bef
             fo.close()
5e9bef
-            del fo
5e9bef
             
5e9bef
         # This screws up the length, but that shouldn't matter. We only care
5e9bef
         # if this checksum == what we expect.
5e9bef
commit 7cd5919c13e4e5efbd9c0b291124893e550e3633
5e9bef
Author: Vratislav Podzimek <vpodzime@redhat.com>
5e9bef
Date:   Tue Apr 15 09:46:23 2014 -0400
5e9bef
5e9bef
    Remove CHUNK argument from open, in checksum. BZ 1058297.
5e9bef
5e9bef
diff --git a/yum/misc.py b/yum/misc.py
5e9bef
index cdc08a0..6850ae2 100644
5e9bef
--- a/yum/misc.py
5e9bef
+++ b/yum/misc.py
5e9bef
@@ -351,7 +351,7 @@ def checksum(sumtype, file, CHUNK=2**16, datasize=None):
5e9bef
         if type(file) not in types.StringTypes:
5e9bef
             fo = file # assume it's a file-like-object
5e9bef
         else:           
5e9bef
-            fo = open(file, 'r', CHUNK)
5e9bef
+            fo = open(file, 'r')
5e9bef
 
5e9bef
         data = Checksums([sumtype])
5e9bef
         while data.read(fo, CHUNK):