-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Python 3.7.6: urllib3.exceptions.ProxySchemeUnknown #5297
Comments
Thanks for reporting this issue and doing investigation! You can fix this by using |
you can solve the problem??
you can solve the problem?? |
|
yes, this fixes the issue for 3.7.6 or 3.8.x |
I observed the same error. As already mentioned above, i also can solve the problem by adding a leading
|
It looks like Seth has answered this and it's working as expected now. Going to resolve, thanks everyone. |
The fix is not applicable if one is using another library and has no direct control over the proxy urls. I think the solution should be to fix the way
The issues seems that urlsplit searches for the first ":" and assumes everything to the right to be the scheme - unless it contains an illegal character(a non-alphanumeric character except +-.).
prefixing it with "//" - as is expected by urlparse - works:
Maybe prepend_scheme can first check for the presence of a scheme and then call urlparse with the prepended "//"? |
When I try to update by conda, I had received this following report Traceback (most recent call last): Last one mean it is similar problem. |
I try to change it, however, the manner may be bad (base) C:\Users\Shungo>conda update conda >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
|
I sove this by modify pip_vendor\requests\adapters.py
|
Sorry I still don't get what I should alter here: proxy={'http': '91.98.102.84:1080', 'https': '91.98.102.84:1080'}
import requests
url='https://httpbin.org/ip'
r=requests.get(url,proxies=proxy,timeout=7)
|
|
This solution doesn't work with python 3.9.1 version, by running the below code, I get Errors:
By running the code I get:
Translation of the error's last line: |
Try like this it will be working , import requests |
I had to re-edit my answer. urllib3 and requests proxy implementations are distinctly different. From requests: Notice there is no "s" in https property value. import requests
proxies = {
'http': 'http://10.10.1.10:3128',
'https': 'http://10.10.1.10:1080',
^
}
requests.get('http://example.org', proxies=proxies) From urllib3: >>> import urllib3
>>> proxy = urllib3.ProxyManager('http://localhost:3128/')
>>> proxy.request('GET', 'http://google.com/') |
not working for me :( |
@Zeyrox-Zy I just updated my answer. |
proxy = {'http':'http://127.0.0.1:8000/', 'https':'http://127.0.0.1:8000/'} this is not working as well. |
Proxy setup without scheme is not working on Python 3.7.6
While it works on Python 3.7.5:
Is not under Python 3.7.6
It seems that some changes on Python
urllib.parse.urlparse
brakerequests.utils.prepend_scheme_if_needed
So it looks like this utils has to update to match Python changes (I think the change that produces this is python/cpython@5a88d50). In both cases I'm using requests 2.22.0.
Reporting here since
urllib.parse.urlparse
behaviour is wrong in both Python versions and I think the problem isrequests.utils.prepend_scheme_if_needed
problem:Python 3.7.5
Python 3.7.6
The text was updated successfully, but these errors were encountered: