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

Requests get fails when env proxy does not have prefix #1520

Closed
juliusgawlas opened this issue Aug 8, 2013 · 2 comments
Closed

Requests get fails when env proxy does not have prefix #1520

juliusgawlas opened this issue Aug 8, 2013 · 2 comments

Comments

@juliusgawlas
Copy link

I am running requests release 1.2.3 and had problem that I tracked down to the following:

$ export http_proxy=some-proxy.this.that
$ python

import requests
requests.get('http://github.com')

gets:

Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/api.py", line 55, in get
return request('get', url, *_kwargs)
File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/api.py", line 44, in request
return session.request(method=method, url=url, *_kwargs)
File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/sessions.py", line 335, in request
resp = self.send(prep, *_send_kwargs)
File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/sessions.py", line 438, in send
r = adapter.send(request, *_kwargs)
File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/adapters.py", line 272, in send
conn = self.get_connection(request.url, proxies)
File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/adapters.py", line 197, in get_connection
conn = ProxyManager(self.poolmanager.connection_from_url(proxy))
File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/packages/urllib3/poolmanager.py", line 123, in connection_from_url
return self.connection_from_host(u.host, port=u.port, scheme=u.scheme)
File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/packages/urllib3/poolmanager.py", line 109, in connection_from_host
pool = self._new_pool(scheme, host, port)
File "/usr/lib/python2.6/site-packages/requests-1.2.3-py2.6.egg/requests/packages/urllib3/poolmanager.py", line 72, in _new_pool
pool_cls = pool_classes_by_scheme[scheme]
KeyError: 'some-proxy.this.that'

This seems to be related to Issue #997
If
$ export http_proxy=http://some-proxy.this.that

all works fine.

Sorry if I missing anything obvious.

Julius
(requests is awesome!)

@Lukasa
Copy link
Member

Lukasa commented Aug 8, 2013

Thanks for raising this! This should be fixed in the next major release of Requests by #1497. =D

@Lukasa Lukasa closed this as completed Aug 8, 2013
@juliusgawlas
Copy link
Author

Thanks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 9, 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