radareorg / radare2-r2pipe

Access radare2 via pipe from any programming language!
389 stars 99 forks source link

pip install r2pipe fails on urllib *SOLUTION* #122

Closed BwRy closed 8 months ago

BwRy commented 4 years ago

Describe the issue When attempting to install r2pipe for python2, the following error caused by urllib API changes is observed:

    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-sRj7ls/r2pipe/setup.py", line 3, in <module>
        import r2pipe
      File "r2pipe/__init__.py", line 38, in <module>
        from r2pipe.open_sync import open
      File "r2pipe/open_sync.py", line 15, in <module>
        from urllib.error import URLError
    ImportError: No module named error

This issue is caused by urllib API changes

How to reproduce?

You can reproduce this by running the following:

lusr@machine:/home/lusr/somesanepath/$ sudo pip install r2pipe

Expected behavior

Installation of r2pipe

Possible fix Edit the file in r2pipe/open_sync.py:

#from urllib.error import URLError
from urllib2 import HTTPError
#from urllib.request import urlopen
from urllib import *
trufae commented 4 years ago

Make a pr instead of opening an issue describing the instructions

trufae commented 4 years ago

Also python2 support was removed on purpose a year ago.

ITAYC0HEN commented 4 years ago

Hey! Indeed, as @trufae said, the support for Python2 was dropped in r2pipe. Do you experience the same issue with Python3? If so, we can look into it. If it is only relevant for Python2, then I'm afraid that this will not be supported anymore.

Please let us know if it is also relevant to Python3