Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 2240475

Summary: ELF module broken by pyelftools update
Product: [Fedora] Fedora Reporter: alex
Component: python-pwntoolsAssignee: W. Michael Petullo <redhat>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 38CC: epel-packagers-sig, rebus, redhat
Target Milestone: ---Keywords: Regression, Upgrades
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: python-pwntools-4.11.0-2.fc39 python-pwntools-4.11.0-2.fc38 Doc Type: ---
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-10-03 13:59:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description alex 2023-09-24 19:03:59 UTC
The pyelftools 0.30 update removed the elftools.common.py3compat module, which the currently-packaged version of Pwntools uses. This causes a ModuleNotFoundError when attempting to import Pwntools. Updating to Pwntools 4.11.0 should fix this.

Reproducible: Always

Steps to Reproduce:
Run `from pwn import *` in Python.
Actual Results:  
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.11/site-packages/pwn/__init__.py", line 4, in <module>
    from pwn.toplevel import *
  File "/usr/lib/python3.11/site-packages/pwn/toplevel.py", line 23, in <module>
    from pwnlib import *
  File "/usr/lib/python3.11/site-packages/pwnlib/dynelf.py", line 57, in <module>
    from pwnlib import elf
  File "/usr/lib/python3.11/site-packages/pwnlib/elf/__init__.py", line 9, in <module>
    from pwnlib.elf.corefile import Core
  File "/usr/lib/python3.11/site-packages/pwnlib/elf/corefile.py", line 79, in <module>
    from elftools.common.py3compat import bytes2str
ModuleNotFoundError: No module named 'elftools.common.py3compat'

Expected Results:  
The import statement executes without error.

Fix: https://github.com/Gallopsled/pwntools/pull/2261

Comment 1 Fedora Update System 2023-09-25 11:00:14 UTC
FEDORA-2023-f146d7c21d has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-f146d7c21d

Comment 2 Fedora Update System 2023-09-25 11:05:52 UTC
FEDORA-2023-65c4dfb440 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-65c4dfb440

Comment 3 Fedora Update System 2023-09-26 01:26:11 UTC
FEDORA-2023-f146d7c21d has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-f146d7c21d`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-f146d7c21d

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2023-09-26 02:29:20 UTC
FEDORA-2023-65c4dfb440 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-65c4dfb440`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-65c4dfb440

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2023-10-03 13:59:03 UTC
FEDORA-2023-f146d7c21d has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 6 Fedora Update System 2023-10-04 02:33:47 UTC
FEDORA-2023-65c4dfb440 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.