Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pwntools is broken #72172

Closed
d4g opened this issue Oct 28, 2019 · 4 comments · Fixed by #72879
Closed

pwntools is broken #72172

d4g opened this issue Oct 28, 2019 · 4 comments · Fixed by #72879
Assignees
Labels

Comments

@d4g
Copy link
Contributor

d4g commented Oct 28, 2019

Issue description

If I try to import pwntools in python2 I get an error message.

Steps to reproduce

  • start python2
  • type import pwn:
[GCC 8.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pwn
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/nix/store/i8q2xzdbcnkk2xw6alsjbm9xdci6f3ry-python-2.7.16-env/lib/python2.7/site-packages/pwn/__init__.py", line 4, in <module>
    from pwn.toplevel import *
  File "/nix/store/i8q2xzdbcnkk2xw6alsjbm9xdci6f3ry-python-2.7.16-env/lib/python2.7/site-packages/pwn/toplevel.py", line 20, in <module>
    import pwnlib
  File "/nix/store/i8q2xzdbcnkk2xw6alsjbm9xdci6f3ry-python-2.7.16-env/lib/python2.7/site-packages/pwnlib/__init__.py", line 43, in <module>
    importlib.import_module('.%s' % module, 'pwnlib')
  File "/nix/store/wgyz97006zqjld121c0hq0gg58c39xm3-python-2.7.16/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/nix/store/i8q2xzdbcnkk2xw6alsjbm9xdci6f3ry-python-2.7.16-env/lib/python2.7/site-packages/pwnlib/dynelf.py", line 56, in <module>
    from pwnlib import elf
  File "/nix/store/i8q2xzdbcnkk2xw6alsjbm9xdci6f3ry-python-2.7.16-env/lib/python2.7/site-packages/pwnlib/elf/__init__.py", line 9, in <module>
    from pwnlib.elf.corefile import Core
  File "/nix/store/i8q2xzdbcnkk2xw6alsjbm9xdci6f3ry-python-2.7.16-env/lib/python2.7/site-packages/pwnlib/elf/corefile.py", line 84, in <module>
    from pwnlib.elf.elf import ELF
  File "/nix/store/i8q2xzdbcnkk2xw6alsjbm9xdci6f3ry-python-2.7.16-env/lib/python2.7/site-packages/pwnlib/elf/elf.py", line 54, in <module>
    from elftools.elf.enums import ENUM_P_TYPE
ImportError: cannot import name ENUM_P_TYPE
  • type from pwn import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/nix/store/i8q2xzdbcnkk2xw6alsjbm9xdci6f3ry-python-2.7.16-env/lib/python2.7/site-packages/pwn/__init__.py", line 4, in <module>
    from pwn.toplevel import *
  File "/nix/store/i8q2xzdbcnkk2xw6alsjbm9xdci6f3ry-python-2.7.16-env/lib/python2.7/site-packages/pwn/toplevel.py", line 20, in <module>
    import pwnlib
  File "/nix/store/i8q2xzdbcnkk2xw6alsjbm9xdci6f3ry-python-2.7.16-env/lib/python2.7/site-packages/pwnlib/__init__.py", line 43, in <module>
    importlib.import_module('.%s' % module, 'pwnlib')
  File "/nix/store/wgyz97006zqjld121c0hq0gg58c39xm3-python-2.7.16/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/nix/store/i8q2xzdbcnkk2xw6alsjbm9xdci6f3ry-python-2.7.16-env/lib/python2.7/site-packages/pwnlib/dynelf.py", line 56, in <module>
    from pwnlib import elf
  File "/nix/store/i8q2xzdbcnkk2xw6alsjbm9xdci6f3ry-python-2.7.16-env/lib/python2.7/site-packages/pwnlib/elf/__init__.py", line 9, in <module>
    from pwnlib.elf.corefile import Core
  File "/nix/store/i8q2xzdbcnkk2xw6alsjbm9xdci6f3ry-python-2.7.16-env/lib/python2.7/site-packages/pwnlib/elf/corefile.py", line 81, in <module>
    from pwnlib import atexit
ImportError: cannot import name atexit

Technical details

Please run nix run nixpkgs.nix-info -c nix-info -m and paste the result.

  • system: "x86_64-linux"
  • host os: Linux 5.3.5, NixOS, 20.03pre196586.b943338ea58 (Markhor)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.3.1
  • channels(root): "nixos-20.03pre196586.b943338ea58"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos
@d4g
Copy link
Contributor Author

d4g commented Oct 28, 2019

@bennofs @kristoff3r

@kristoff3r
Copy link
Contributor

I'll take a look at it, thanks for letting me know

@jonringer
Copy link
Contributor

This is an upstream issue Gallopsled/pwntools#1189, reverting pyelftools to 0.24 does in fact fix it.

Seeing as this has been an issue for a year, not sure how quickly they will fix it

@kristoff3r
Copy link
Contributor

I'm actively working with the maintainers to get a new release out (the current defacto maintainers didn't have access to do the releases). When that happens the fix should be a simple version bump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants