Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 635116 - sys-apps/portage: is_prelinkable_elf always returns False for python3
Summary: sys-apps/portage: is_prelinkable_elf always returns False for python3
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 631448
  Show dependency tree
 
Reported: 2017-10-22 22:26 UTC by Zac Medico
Modified: 2018-02-01 23:56 UTC (History)
0 users

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


Attachments

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