BRGM / gml_application_schema_toolbox

GML Application Schema toolbox is a QGIS plugin allowing to manipulate OGC Complex Features
https://brgm.github.io/gml_application_schema_toolbox/
GNU General Public License v2.0
26 stars 17 forks source link

Proxy setting restore seems broken #264

Open kannes opened 1 year ago

kannes commented 1 year ago

https://github.com/BRGM/gml_application_schema_toolbox/blob/607accd5fc69892878d432694947517bdb7acb2b/gml_application_schema_toolbox/core/proxy.py#L55-L60

The line os.environ["http_proxy"] = self.http_proxy appears twice: https://github.com/BRGM/gml_application_schema_toolbox/blob/607accd5fc69892878d432694947517bdb7acb2b/gml_application_schema_toolbox/core/proxy.py#L56

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)