Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 606120 - app-portage/gentoolkit aborts when parsing glsa-201701-36.xml
Summary: app-portage/gentoolkit aborts when parsing glsa-201701-36.xml
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Gentoo Security
URL:
Whiteboard:
Keywords:
: 606140 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-01-17 21:32 UTC by David Michael
Modified: 2017-01-18 02:36 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
This fixes the error (0001-gentoolkit-glsa-Fix-AttributeError-from-int-coercion.patch,693 bytes, patch)
2017-01-17 21:32 UTC, David Michael
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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. ***