Skip to content

Commit 84fd957

Browse files
authored
Pass the session's proxies property to request
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.
1 parent 3fd3a97 commit 84fd957

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/pip/_internal/network/session.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ def is_secure_origin(self, location: Link) -> bool:
449449
def request(self, method: str, url: str, *args: Any, **kwargs: Any) -> Response:
450450
# Allow setting a default timeout on a session
451451
kwargs.setdefault("timeout", self.timeout)
452+
# Allow setting a default proxies on a session
453+
kwargs.setdefault("proxies", self.proxies)
452454

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

0 commit comments

Comments
 (0)