Closed jayvdb closed 5 years ago
@jayvdb
The above error occurs due to the recent change in the Safety
package which has been release on 5th Feb (Today). The new version comes with the added functionality to support proxies which the Requests
module of python uses. The new argument is now passed in safety.check()
. And hence the addition of new positional argument.
The commit which made these changes is here
It is important to note that the proxy argument here is then passed onto Requests in safety.py. For more information about proxy please refer to the Requests Documentation- Proxy section
In order to fix the above Travis error we would now have to pass an additional argument called as proxy in the PySafetyBear at the line. The new safety.check() function should look like:
proxy = {}
for vulnerability in safety.check(packages, key=None,
db_mirror=db_path, cached=False,
ignore_ids=cve_ignore, proxy=proxy):
if 'cve' in vulnerability.vuln_id.strip().lower():
The argument proxy is a dictionary
datatype which holds values something like:
proxies = {
"http": "10.10.1.10:3128",
"https": "10.10.1.10:1080",
}
Since we don't use any proxies, I guess we can leave it as a empty dictionary like proxy = {}
The reference for the above thing is taken from StackOverflow and Requests Docs
The tests for the above new argument can be found at test_safety of the Safety library.
Since we don't use any proxies, I guess we can leave it as a empty dictionary like proxy = {}
Yup, that is what we should do.
It might also be possible to set proxy=None
, and that would be preferred way to indicate no proxy are requested.
https://travis-ci.org/jayvdb/coala-bears/jobs/488802415