Setting proxy settings for the requests session manually from the environment variables is not necessary, since requests handles it itself.
When the proxies configuration is not overridden per request as shown above, Requests relies on the proxy configuration defined by standard environment variables http_proxy, https_proxy, no_proxy, and all_proxy. Uppercase variants of these variables are also supported.
In fact the way it is currently implemented the contents of the no_proxy variable is ignored, preventing the following common use case:
Results in a connection error depending on the proxy behavior. Some proxies redirect, some proxies just hang up. The latter is the case especially when the proxy is not located inside the corporate network.
This change just removes the redundant proxy setup code so that requests can handle all proxy setup itself.
Setting proxy settings for the
requests
session manually from the environment variables is not necessary, sincerequests
handles it itself.In fact the way it is currently implemented the contents of the
no_proxy
variable is ignored, preventing the following common use case:Results in a connection error depending on the proxy behavior. Some proxies redirect, some proxies just hang up. The latter is the case especially when the proxy is not located inside the corporate network.
This change just removes the redundant proxy setup code so that
requests
can handle all proxy setup itself.