-
Notifications
You must be signed in to change notification settings - Fork 42
Description
The documentation refers to the use of HelperMethods.proxy_experimental to enable the use of a proxy server for e.g. license activation. The premise is the following:
- Set
HelperMethods.proxy_experimental = Truein your own code. - The
send_requestmethod ininternal.pychecks whether the variable is set, and if so, "enables the proxy".
The second point specifically is implemented here. Except... it is only partially implemented, it seems.
When we check that section of the code, we find that the request is properly prepared with req.set_proxy(proxies['http'], 'http') etc. However, the line where the request is effectively sent (return urllib.request.urlopen...) can never be reached with a proxy set, because it is part of the other branch of the if statement for if HelperMethods.proxy_experimental == True:!
In other words, you can either set the proxy and not send the request, or not set the proxy and then send the request. Supposedly removing the else: clause/line and unindenting the line below with return urllib.request.urlopen... could work?
That would mean the full snippet (line 162 to 173) becomes:
if HelperMethods.proxy_experimental == True:
proxies = urllib.request.getproxies()
if proxies != {}:
if 'http' in proxies:
req.set_proxy(proxies['http'], 'http')
if 'https' in proxies:
req.set_proxy(proxies['https'], 'https')
return urllib.request.urlopen(req).read().decode("utf-8")
Not sure if that makes sense? I am no developer but happy to e.g. open a pull request and do whatever is necessary to suggest and test this fix, but I have no experience with that procedure.