Nixpkgs: pwntools is broken

Created on 28 Oct 2019  路  4Comments  路  Source: NixOS/nixpkgs

Issue description

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

Steps to reproduce

  • start python2
  • type import pwn:
    ```Python 2.7.16 (default, Mar 2 2019, 18:34:01)
    [GCC 8.3.0] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import pwn
    Traceback (most recent call last):
    File "", line 1, in
    File "/nix/store/i8q2xzdbcnkk2xw6alsjbm9xdci6f3ry-python-2.7.16-env/lib/python2.7/site-packages/pwn/__init__.py", line 4, in
    from pwn.toplevel import *
    File "/nix/store/i8q2xzdbcnkk2xw6alsjbm9xdci6f3ry-python-2.7.16-env/lib/python2.7/site-packages/pwn/toplevel.py", line 20, in
    import pwnlib
    File "/nix/store/i8q2xzdbcnkk2xw6alsjbm9xdci6f3ry-python-2.7.16-env/lib/python2.7/site-packages/pwnlib/__init__.py", line 43, in
    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
    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
    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
    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
    from elftools.elf.enums import ENUM_P_TYPE
    ImportError: cannot import name ENUM_P_TYPE
- type ```from pwn import *```
```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
bug python

Most helpful comment

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

All 4 comments

@bennofs @kristoff3r

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

This is an upstream issue https://github.com/Gallopsled/pwntools/issues/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

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

langston-barrett picture langston-barrett  路  3Comments

yawnt picture yawnt  路  3Comments

spacekitteh picture spacekitteh  路  3Comments

domenkozar picture domenkozar  路  3Comments