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

ProxySchemeUnknown on Python 3.9 #5896

Closed
iwalucas opened this issue Aug 1, 2021 · 3 comments
Closed

ProxySchemeUnknown on Python 3.9 #5896

iwalucas opened this issue Aug 1, 2021 · 3 comments

Comments

@iwalucas
Copy link

iwalucas commented Aug 1, 2021

During an upgrade from python 3.7 to 3.9 I face an error similar to the one reported on #5297.

The proxies are defined on the system level (export http_proxy and export https_proxy).

It works fine on 3.7.

Expected Result

Requests respect the proxy

Actual Result

Proxy causes the request fo fail

Reproduction Steps

import requests
headers={}
payload={}
url='https://www.someurl.com'
response = requests.request("POST", url, headers=headers, data = payload)

System Information

$ python -m requests.help
{
  "chardet": {
    "version": "3.0.4"
  },
  "cryptography": {
    "version": ""
  },
  "idna": {
    "version": "2.8"
  },
  "implementation": {
    "name": "CPython",
    "version": "3.9.6"
  },
  "platform": {
    "release": "20.6.0",
    "system": "Darwin"
  },
  "pyOpenSSL": {
    "openssl_version": "",
    "version": null
  },
  "requests": {
    "version": "2.22.0"
  },
  "system_ssl": {
    "version": "101010bf"
  },
  "urllib3": {
    "version": "1.25.11"
  },
  "using_pyopenssl": false
}

Traceback

   response = requests.request("POST", url, headers=headers, data = payload)
 File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 60, in request
   return session.request(method=method, url=url, **kwargs)
 File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 533, in request
   resp = self.send(prep, **send_kwargs)
 File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 646, in send
   r = adapter.send(request, **kwargs)
 File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 412, in send
   conn = self.get_connection(request.url, proxies)
 File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 309, in get_connection
   proxy_manager = self.proxy_manager_for(proxy)
 File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 193, in proxy_manager_for
   manager = self.proxy_manager[proxy] = proxy_from_url(
 File "/usr/local/lib/python3.9/site-packages/urllib3/poolmanager.py", line 492, in proxy_from_url
   return ProxyManager(proxy_url=url, **kw)
 File "/usr/local/lib/python3.9/site-packages/urllib3/poolmanager.py", line 429, in __init__
   raise ProxySchemeUnknown(proxy.scheme)
@nateprewitt
Copy link
Member

Hi @iwalucas, can you please provide the proxies you’re using, or at least an identical format with sensitive info substituted? There isn’t enough information to determine if this is the same issue as #5297 or #5855.

In either case, this is almost certainly a duplicate.

@iwalucas
Copy link
Author

iwalucas commented Aug 1, 2021

@nateprewitt I think its a duplicate of #5855...
here are the proxies:

HTTP_PROXY=proxy.mydomain.com:3128
HTTPS_PROXY=proxy.mydomain.com:3128

@nateprewitt
Copy link
Member

I've added an update in #5855, we'll track further conversations around this there. I'll resolve this as a duplicate for now. Thanks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants