Inside summarylist(), it's possible for myglsa.packages.keys() to contain
authorzmedico <zmedico@gentoo.org>
Sat, 21 Feb 2009 01:59:02 +0000 (01:59 -0000)
committerzmedico <zmedico@gentoo.org>
Sat, 21 Feb 2009 01:59:02 +0000 (01:59 -0000)
unicode objects, which trigger and exception like this:

File "//usr/lib64/portage/pym/portage/dep.py", line 535, in __init__
obj_setattr(self, x, getattr(s, x))
AttributeError: 'unicode' object has no attribute '__eq__'

To solve this problem, convert unicode objects to plain str before passing
them to the portage api. Thanks to Ned Ludd <solar@g.o> for reporting.

svn path=/; revision=548

trunk/src/glsa-check/glsa-check

index 7d3931afee176b78b2876cd862d9df58cc41c57a..efb9e913338af8584301273a8139cc801b6d6116 100755 (executable)
@@ -222,7 +222,7 @@ def summarylist(myglsalist, fd1=sys.stdout, fd2=sys.stderr):
                                fd1.write("... ")
                else:
                        for pkg in myglsa.packages.keys():
-                               mylist = vardb.match(portage.dep_getkey(pkg))
+                               mylist = vardb.match(portage.dep_getkey(str(pkg)))
                                if len(mylist) > 0:
                                        pkg = color(" ".join(mylist))
                                fd1.write(" " + pkg + " ")