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

Proxy setting restore seems broken #264

Open
kannes opened this issue Feb 10, 2023 · 0 comments
Open

Proxy setting restore seems broken #264

kannes opened this issue Feb 10, 2023 · 0 comments

Comments

@kannes
Copy link

kannes commented Feb 10, 2023

if self.http_proxy is not None:
os.environ["http_proxy"] = self.http_proxy
os.environ["http_proxy"] = self.http_proxy
else:
os.environ.pop("http_proxy", None)
os.environ.pop("https_proxy", None)

The line os.environ["http_proxy"] = self.http_proxy appears twice:

os.environ["http_proxy"] = self.http_proxy

while the https_proxy environment variable is not restored.

It should probably rather read:

if self.http_proxy is not None: 
     os.environ["http_proxy"] = self.http_proxy 
else: 
     os.environ.pop("http_proxy", None) 
if self.https_proxy is not None:
     os.environ["https_proxy"] = self.https_proxy 
else:
     os.environ.pop("https_proxy", None) 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant