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

Bug 417233

Summary: app-portage/gentoolkit - glsa-check --dump does not work with python3
Product: Portage Development Reporter: Alexander Zubkov <zubkov318>
Component: ToolsAssignee: Portage Tools Team <tools-portage>
Status: RESOLVED FIXED    
Severity: normal CC: gentoo, matt+bugzilla
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 346443    

Description Alexander Zubkov 2012-05-23 08:11:31 UTC
I'm receiving such error when calling "glsa-check --dump affected" and having python-3* selected:

Traceback (most recent call last):
  File "/usr/bin/glsa-check", line 268, in <module>
    myglsa.dump()
  File "/usr/lib64/python3.1/site-packages/gentoolkit/glsa/__init__.py", line 628, in dump
    outstream.write(center("GLSA %s: \n%s" % (self.nr, self.title), width)+"\n")
  File "/usr/lib64/python3.1/site-packages/gentoolkit/glsa/__init__.py", line 64, in center
    rValue = " "*margin
TypeError: can't multiply sequence by non-int of type 'float'

Looks like this line (64) in /usr/lib64/python3.1/site-packages/gentoolkit/glsa/__init__.py:
        margin = (width-len(text))/2
        rValue = " "*margin
Should be changed to something like (not sure in Python syntax):
        margin = int((width-len(text))/2)
Comment 1 Paul Varner (RETIRED) gentoo-dev 2012-05-24 05:47:04 UTC
The fix is to change the line:
margin = (width-len(text))/2
to:
margin = (width-len(text))//2

Python2 did integer floor division by default and Python3 does not.  I'll fix the code and it will be in the next release.
Comment 2 Alexander Zubkov 2012-09-27 03:49:34 UTC
Hi. When the next release will be available?
Comment 3 Marc Schiffbauer gentoo-dev 2012-11-04 23:06:26 UTC
I would consider this a much higher importance because currently glsa-check is broken for all systems that use python3

Or in other words: Gentoo's tool for doing security updates is broken in its current stable version when using a "default" python setup.
Comment 4 Paul Varner (RETIRED) gentoo-dev 2012-11-06 17:27:42 UTC
Released in gentoolkit-0.3.0.7
Comment 5 Paul Varner (RETIRED) gentoo-dev 2012-11-26 23:33:39 UTC
*** Bug 444650 has been marked as a duplicate of this bug. ***