CiscoPSIRT / openVulnAPI

Documentation and Tools for Cisco's PSIRT openVuln API
https://developer.cisco.com/psirt/
MIT License
102 stars 52 forks source link

Support Python 3 #41

Closed phillipdwright closed 6 years ago

phillipdwright commented 7 years ago

This is a request for Python 3 support for this tool. There are a few incompatibilities, but they seem fairly minor.

phillipdwright commented 7 years ago

I'd be interested in helping with this, if you're open to outside contributions.

fgs-pwright commented 6 years ago

Is there any interest in this? I would like to use this API wrapper from within a project written to target Python 3.6.

santosomar commented 6 years ago

Thank you for your contribution @phillipdwright ! I have approved your pull request!

isidrov commented 6 years ago

I am having issues to run it on python3. I understand the issue is still open?

Traceback (most recent call last): File "/usr/local/bin/openVulnQuery", line 11, in load_entry_point('OpenVulnQuery==1.26', 'console_scripts', 'openVulnQuery')() File "/usr/local/lib/python3.5/site-packages/pkg_resources/init.py", line 572, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/usr/local/lib/python3.5/site-packages/pkg_resources/init.py", line 2752, in load_entry_point return ep.load() File "/usr/local/lib/python3.5/site-packages/pkg_resources/init.py", line 2405, in load return self.resolve() File "/usr/local/lib/python3.5/site-packages/pkg_resources/init.py", line 2411, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "/usr/local/lib/python3.5/site-packages/openVulnQuery/main.py", line 4, in import config ImportError: No module named 'config'

phillipdwright commented 6 years ago

@isidrov Did you install using pip? It looks like the version of this package on PyPI does not have the latest changes (note it was uploaded May 2017). You may need to download it directly from GitHub to use it with Python 3.

waukeerules commented 6 years ago

Does openVulnAPI work with Python 3.6.5? I haven't been able to get the module to load properly using pip.

phillipdwright commented 6 years ago

@waukeerules If you just do pip install openVulnQuery, you'll be installing from PyPI, which looks to be an old version before Python 3 compatibility was established. You could download the latest code directly from GitHub and install it as downloaded, if you needed Python 3 compatibility.

waukeerules commented 6 years ago

Thank you @phillipdwright. I was able to get the latest code installed by running python setup.py install. I did this yesterday, but I didn't think it worked because the documentation I was following was outdated or misleading.

OLD SYNTAX - Does not work.

query_client = query_client.QueryClient(client_id="", client_secret="")

NEW SYNTAX - Works

query_client = query_client.OpenVulnQueryClient(client_id="", client_secret="")

santosomar commented 6 years ago

Thank you @waukeerules ! I just updated the query_client documentation in the README via https://github.com/CiscoPSIRT/openVulnAPI/commit/46b162de70183550572235db80f701b318fafcb2