You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use pwntools in a SageMath script. This works great interactively, but when I run my script with sage foo.sage, it fails somewhere in terminal code. I have traced this back to sage unsetting $TERM in non-interactive calls due to https://trac.sagemath.org/ticket/12263. Thus, issue can be easily reproduced without SageMath:
~$ docker run -it pwntools/pwntools:stable
pwntools@bce19e99e965:~$ TERM= python -c 'import pwn'
Warning: error: setupterm: could not find terminfo database
Traceback (most recent call last):
File "<string>", line 1, in<module>
File "/usr/local/lib/python2.7/dist-packages/pwn/__init__.py", line 4, in<module>
from pwn.toplevel import *
File "/usr/local/lib/python2.7/dist-packages/pwn/toplevel.py", line 20, in<module>
import pwnlib
File "/usr/local/lib/python2.7/dist-packages/pwnlib/__init__.py", line 43, in<module>
importlib.import_module('.%s' % module, 'pwnlib')
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/usr/local/lib/python2.7/dist-packages/pwnlib/args.py", line 62, in<module>
from pwnlib import term
File "/usr/local/lib/python2.7/dist-packages/pwnlib/term/__init__.py", line 6, in<module>
from pwnlib.term import completer
File "/usr/local/lib/python2.7/dist-packages/pwnlib/term/completer.py", line 7, in<module>
from pwnlib.term import readline
File "/usr/local/lib/python2.7/dist-packages/pwnlib/term/readline.py", line 13, in<module>
from pwnlib.term import text
File "/usr/local/lib/python2.7/dist-packages/pwnlib/term/text.py", line 126, in<module>
sys.modules[__name__] = Module()
File "/usr/local/lib/python2.7/dist-packages/pwnlib/term/text.py", line 49, in __init__
s = termcap.get(y)
File "/usr/local/lib/python2.7/dist-packages/pwnlib/term/unix_termcap.py", line 28, in get
s = curses.tigetstr(cap)
_curses.error: must call (at least) setupterm() first
The text was updated successfully, but these errors were encountered:
I am trying to use
pwntools
in a SageMath script. This works great interactively, but when I run my script withsage foo.sage
, it fails somewhere in terminal code. I have traced this back to sage unsetting $TERM in non-interactive calls due to https://trac.sagemath.org/ticket/12263. Thus, issue can be easily reproduced without SageMath:The text was updated successfully, but these errors were encountered: