Blame SOURCES/BZ-1259837-igroups-empty-lines.patch

bb45c0
diff -up yum-3.4.3/yum/igroups.py.old yum-3.4.3/yum/igroups.py
bb45c0
--- yum-3.4.3/yum/igroups.py.old	2015-09-09 16:18:23.494390878 +0200
bb45c0
+++ yum-3.4.3/yum/igroups.py	2015-09-09 17:10:33.451517354 +0200
bb45c0
@@ -43,6 +43,12 @@ def _makedirs_no_umask(*args):
bb45c0
 
bb45c0
     return ret
bb45c0
 
bb45c0
+def _read_str(fo):
bb45c0
+    for s in fo:
bb45c0
+        if s[:-1]:
bb45c0
+            return s[:-1]
bb45c0
+    return ''
bb45c0
+
bb45c0
 class InstalledGroup(object):
bb45c0
     def __init__(self, gid):
bb45c0
         self.gid       = gid
bb45c0
@@ -107,11 +113,11 @@ class InstalledGroups(object):
bb45c0
         if not os.access(self.filename, os.R_OK):
bb45c0
             return
bb45c0
 
bb45c0
-        def _read_str(fo):
bb45c0
-            return fo.readline()[:-1]
bb45c0
-
bb45c0
         fo = open(self.filename)
bb45c0
-        ver = int(_read_str(fo))
bb45c0
+        try:
bb45c0
+            ver = int(_read_str(fo))
bb45c0
+        except ValueError:
bb45c0
+            return
bb45c0
         if ver != 1:
bb45c0
             return
bb45c0
 
bb45c0
@@ -132,11 +138,11 @@ class InstalledGroups(object):
bb45c0
         if not os.access(self.grp_filename, os.R_OK):
bb45c0
             return
bb45c0
 
bb45c0
-        def _read_str(fo):
bb45c0
-            return fo.readline()[:-1]
bb45c0
-
bb45c0
         fo = open(self.grp_filename)
bb45c0
-        ver = int(_read_str(fo))
bb45c0
+        try:
bb45c0
+            ver = int(_read_str(fo))
bb45c0
+        except ValueError:
bb45c0
+            return
bb45c0
         if ver != 1:
bb45c0
             return
bb45c0