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

Bug 635116

Summary: sys-apps/portage: is_prelinkable_elf always returns False for python3
Product: Portage Development Reporter: Zac Medico <zmedico>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal Keywords: InVCS
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 631448    

Description Zac Medico gentoo-dev 2017-10-22 22:26:08 UTC
This code doesn't work as intended in python3, because magic[16] is an integer:

   magic[16] in (b'\x02', b'\x03')

So is_prelinkable_elf always returns False for python3:

$ python3 -c "from portage.checksum import is_prelinkable_elf
print(is_prelinkable_elf('/bin/bash'))"
False
$ python2.7 -c "from portage.checksum import is_prelinkable_elf
print(is_prelinkable_elf('/bin/bash'))"
True
Comment 1 Larry the Git Cow gentoo-dev 2017-10-22 22:33:47 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=5575570894c064976f701831d5a15bfa7f529935

commit 5575570894c064976f701831d5a15bfa7f529935
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2017-10-22 22:30:15 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2017-10-22 22:33:02 +0000

    is_prelinkable_elf: fix for python3 (bug 635116)
    
    Change magic[16] to magic[16:17], since magic[16] returns
    an integer for python3.
    
    Bug: https://bugs.gentoo.org/635116

 pym/portage/checksum.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)}