Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 606120

Summary: app-portage/gentoolkit aborts when parsing glsa-201701-36.xml
Product: Gentoo Linux Reporter: David Michael <fedora.dm0>
Component: Current packagesAssignee: Gentoo Security <security>
Status: RESOLVED FIXED    
Severity: normal CC: kalin
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: This fixes the error

Description David Michael 2017-01-17 21:32:15 UTC
Created attachment 460490 [details, diff]
This fixes the error

There is an attempted call of `int(count)` where `count` is an instance of `Attr`.  This raises an `AttributeError`, which is not caught.  The following is the traceback.

Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/glsa-check", line 340, in <module>
    myglsa = Glsa(myid, glsaconfig)
  File "/usr/lib64/python2.7/site-packages/gentoolkit/glsa/__init__.py", line 509, in __init__
    self.read()
  File "/usr/lib64/python2.7/site-packages/gentoolkit/glsa/__init__.py", line 527, in read
    self.parse(urlopen(myurl))
  File "/usr/lib64/python2.7/site-packages/gentoolkit/glsa/__init__.py", line 574, in parse
    self.count = int(count)
AttributeError: Attr instance has no attribute '__trunc__'

I've attached a patch that coerces the attribute value to an integer (a string instead of an `Attr` object).
Comment 1 Mart Raudsepp gentoo-dev 2017-01-17 22:34:41 UTC
bug 605612 is handling the glsa-check fixes, while here we need to revert the revision to the old method meanwhile.
bug 605612 took the other way for the patch right now (getAttribute call and then a falsy check for fallback instead of "is None"), but we need to have this trickle down to users, etc, and meanwhile not use this attribute in published GLSAs yet.
Comment 2 Aaron Bauman (RETIRED) gentoo-dev 2017-01-17 22:49:23 UTC
Fixed. Thanks Mart for the quick patch.
Comment 3 Mart Raudsepp gentoo-dev 2017-01-18 02:36:15 UTC
*** Bug 606140 has been marked as a duplicate of this bug. ***