Closed zephyrj closed 5 years ago
I'm no python expert but I have got around the issue for now by doing:
if not (proxies.get('http') == None):
os.environ['HTTP_PROXY'] = proxies.get('http')
if not (proxies.get('https') == None):
os.environ['HTTPS_PROXY'] = proxies.get('https')
Thanks for reporting this issue!
pypac version: 0.9.0 (retrieved from pip) Python version: Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] on win32
When the configured pac file returns "DIRECT" for a URL then the function will fail with the following error:
In this case the pac file will return "DIRECT" for the url - the code gets to line 303
proxies = resolver.get_proxy_for_requests(url)
which will result in the code going to pypac/resolver.py:133 and the function proxy_parameter_for_requests("DIRECT") will be called. This will then set proxy_url_or_direct to None which will be used for the returns values in the dictionary for 'http' and 'https'. These value of None are used inResulting in the error putenv() argument 2 must be string, not None