Hans-Peter Jansen added the comment:

Hi Martin, hi Senthil,

please find a new patch attached, that incorporates your suggestions.

 * added a comment to get_proxies doc in urllib.rst
 * documented and fixed the mixed case scheme 
 * added a note to proxy_bypass_environment, that behaves slightly 
   different in this respect

Yes, mixed case situations are not handled in proxy_bypass_environment,
just lowercase and uppercase, while lowercase is preferred correctly.
I think, that the mixed case situation is pathologic enough and deserves to be 
ignored here. 

BTW, while looking at the code, I noticed, that most docstrings of the callers 
of proxy_bypass_environment are wrong: they say, that the proxies dict is 
returned, but they return the value of proxy_bypass_environment(), not 
get_proxies().

A follow up patch could do this in order to clean up this mess:
since there's always a call to get_proxies preceding the call to 
proxy_bypass_environment, we could add a second argument to the latter, passing 
in the proxy dict, that is thrown away at the moment. Since that carries a 'no' 
key already, if it exists, using it here would fix this ambiguity. While at it, 
fix up the affected docstrings.

What do you think about the attached patch and the last paragraph?

----------
Added file: 
http://bugs.python.org/file42544/python-urllib-prefer-lowercase-proxies.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26804>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to