arthaud/python3-pwntools

SyntaxError: invalid syntax: "def goto((r, c)):"

nil0x42 opened this issue · 1 comments

issue:

invalid syntax in python 3.6

steps to reproduce:

$ python3.6

python
Python 3.6.0 (default, Dec 24 2016, 08:03:08)
[GCC 6.2.1 20160830] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pwn
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.6/site-packages/pwn/__init__.py", line 2, in <module>
    from .toplevel import *
  File "/usr/lib/python3.6/site-packages/pwn/toplevel.py", line 20, in <module>
    import pwnlib
  File "/usr/lib/python3.6/site-packages/pwnlib/__init__.py", line 40, in <module>
    importlib.import_module('.%s' % module, 'pwnlib')
  File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/usr/lib/python3.6/site-packages/pwnlib/args.py", line 48, in <module>
    from . import term
  File "/usr/lib/python3.6/site-packages/pwnlib/term/__init__.py", line 3, in <module>
    from . import completer
  File "/usr/lib/python3.6/site-packages/pwnlib/term/completer.py", line 4, in <module>
    from . import readline
  File "/usr/lib/python3.6/site-packages/pwnlib/term/readline.py", line 3, in <module>
    from . import term
  File "/usr/lib/python3.6/site-packages/pwnlib/term/term.py", line 157
    def goto((r, c)):
             ^
SyntaxError: invalid syntax

Hi @nil0x42,

Thanks for trying python3-pwntools !

I think you are not using the upstream version of python3-pwntools. The issue with goto((r, c)) has been fixed a while ago, check out the current version: https://github.com/arthaud/python3-pwntools/blob/master/pwnlib/term/term.py#L186

If you installed pwntools through pip, you'll have to reinstall it using:
pip3 install git+https://github.com/arthaud/python3-pwntools.git