Pemburu icon indicating copy to clipboard operation
Pemburu copied to clipboard

Prevent InsecureRequestWarning

Open stabla opened this issue 6 years ago • 0 comments

I wanted to use the script, but a warning appeared and prevented the script to run.

/Library/Python/2.7/lib/python/site-packages/urllib3/connectionpool.py:847: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings

After a quick check on StackOverflow, there's a reason: urllib3 not a part of requests anymore. To disable warnings in requests vendored urllib3, we should import the specific instance of the module.

Adding : from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) in order to prevent it.

stabla avatar Nov 06 '18 11:11 stabla