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

Prevent InsecureRequestWarning #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Prevent InsecureRequestWarning #2

wants to merge 2 commits into from

Conversation

stabla
Copy link

@stabla stabla commented Nov 6, 2018

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 and others added 2 commits November 6, 2018 11:56
Disable warnings in requests vendored urllib3, we should import the specific instance of the module

Warning to avoid: /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
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.

None yet

1 participant