-
Notifications
You must be signed in to change notification settings - Fork 3.1k
pip doesn't use proxy for search command #1104
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
Comments
There are various examples of people creating a urllib2 transport and tunneling xmlrpclib over it, see for example https://gist.github.com/nathforge/980961 .There is even something like this happening in Simply patching |
The replacement of xmlrpclib.ServerProxy() in search.py by the xmlrpclib_ServerProxy() defined below works in my environment of Python 2.7.5 and pip 1.4.1.
|
The above version of ProxiedTransport() used httplib. In contrast, the following uses urllib2. Also works in my environment of Python 2.7.5 and pip 1.4.1.
|
To help make this issue proceed, there is a pull request, #1180, which provides a |
I think that fixes the bug (--proxy ignored) and provides a work arround (pass in --proxy). It would be nice if pip fell back to use HTTP_PROXY environment variable too, but not essential. |
Observed in pip 1.3.1 on CentOS 6.4 with EPEL's packages. Works:
Doesn't work:
|
You don't need to set the proxy handler manually for urllib2 as it automatically detects *_proxy env vars. Also, the code above didn't work for me, didn't care to check throughly why, but it simply wasn't using the proxy although get_proxy() appeared to be finding it. Simplified patch here: https://gist.github.com/spuk-/11256147#file-pip-search-urllib2 |
spuk's solutions is great! - simple and working. Please incorporate it into next release, thanks! |
Should be fixed in 1.6 through #1902 as above |
I'm attempting to use pip to install packages to a python virtualenv. I have however discovered that when trying to search for commands, the proxy is not used. running for example pip search pika fails while pip install pika works fine.
I have set the environment variables http_proxy, https_proxy and no_proxy accordingly and I have tried to set the --proxy option with no success. It does however ask for a password if I specify a username but no password, so at least it acknowledges the options (the proxy is anonymous login)
I run into this issue on RedHat 6.4, with the default Python 2.6.6, and Python 2.7.5 from the tarball distribution.
Here are the logs:
If I run a strace on the process it stops on this message, indicating that it tries to contact the source directly without going via the proxy, thus gets blocked by the firewall.
The text was updated successfully, but these errors were encountered: