Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing python 3 incompatibilities #101

Merged
merged 1 commit into from
Feb 6, 2022
Merged

Conversation

Guilhem-DELAITRE
Copy link
Contributor

I patched incompatibilities by using conditionnal imports and fixing syntax incompatibilities (like parenthesis for print)

I manage to execute all tests series except node one because the docker container build failed (just like on your own branch if I'm not mistaken).

After my changes, I managed to exploit a machine both using python2.7.18 and 3.9.10 using -os-shell.

Thx in advance for feedback.

@epinna epinna merged commit fedec96 into epinna:master Feb 6, 2022
@harunurkst
Copy link

while installing requirements.txt using python3, its showing this error

Collecting wsgiref==0.1.2
  Downloading wsgiref-0.1.2.zip (37 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-bhmziijw/wsgiref_bea7a3e89d1d46988ad801bfa1a41c1f/setup.py", line 5, in <module>
          import ez_setup
        File "/tmp/pip-install-bhmziijw/wsgiref_bea7a3e89d1d46988ad801bfa1a41c1f/ez_setup/__init__.py", line 170
          print "Setuptools version",version,"or greater has been installed."
                ^
      SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Setuptools version",version,"or greater has been installed.")?
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

@Guilhem-DELAITRE
Copy link
Contributor Author

Guilhem-DELAITRE commented Mar 13, 2022

while installing requirements.txt using python3, its showing this error

Collecting wsgiref==0.1.2
  Downloading wsgiref-0.1.2.zip (37 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-bhmziijw/wsgiref_bea7a3e89d1d46988ad801bfa1a41c1f/setup.py", line 5, in <module>
          import ez_setup
        File "/tmp/pip-install-bhmziijw/wsgiref_bea7a3e89d1d46988ad801bfa1a41c1f/ez_setup/__init__.py", line 170
          print "Setuptools version",version,"or greater has been installed."
                ^
      SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Setuptools version",version,"or greater has been installed.")?
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Not sure, but python 3 issue might be the place to post this.

To answer you, I only fixed the incompatibilities in TPLMAP python basecode to make it able to run under python 3, but I didn't automated the install process.

For now you have to manually install whatever package is missing when running it in python 3

The good method would probably be creating a requirements3.txt including python 3 needed package. Feel free to do it because in theory it must be really simple : run tplmap without requirements, see what is missing, and create a requirement3.txt with those missing packets (not sure I'm not very knowledgeable in either python or pip, so I may be mistaken about what should be done)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants