Skip to content

Commit

Permalink
Pass the session's proxies property to request
Browse files Browse the repository at this point in the history
After waiting a long time for a fix on the side of the request that could fix pip install issues with proxy as already discussed in pypa#9691. It seems that such changes as mentioned in psf/requests#5735 will take a while to happen, probably only on version 3 of the request. 

Therefore, I'm suggesting a change on the pip side as already proposed in [issuecomment-79051687]pypa#9568 (comment) and [issuecomment-939373868]psf/requests#5735 (comment) 

I think it's important that pip address this issue asap since the newer versions of pip are not working properly behind a proxy.
  • Loading branch information
junqfisica authored Nov 24, 2021
1 parent 3fd3a97 commit 84fd957
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pip/_internal/network/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ def is_secure_origin(self, location: Link) -> bool:
def request(self, method: str, url: str, *args: Any, **kwargs: Any) -> Response:
# Allow setting a default timeout on a session
kwargs.setdefault("timeout", self.timeout)
# Allow setting a default proxies on a session
kwargs.setdefault("proxies", self.proxies)

# Dispatch the actual request
return super().request(method, url, *args, **kwargs)

0 comments on commit 84fd957

Please sign in to comment.