If I try to import pwntools in python2 I get an error message.
import pwn:- 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
Please run nix run nixpkgs.nix-info -c nix-info -m and paste the result.
"x86_64-linux"Linux 5.3.5, NixOS, 20.03pre196586.b943338ea58 (Markhor)yesyesnix-env (Nix) 2.3.1"nixos-20.03pre196586.b943338ea58"/nix/var/nix/profiles/per-user/root/channels/nixos@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.
Most helpful comment
I'll take a look at it, thanks for letting me know