Index: Python-2.7.1/Lib/urllib.py =================================================================== --- Python-2.7.1.orig/Lib/urllib.py +++ Python-2.7.1/Lib/urllib.py @@ -1350,6 +1350,7 @@ def proxy_bypass_environment(host): hostonly, port = splitport(host) # check if the host ends with any of the DNS suffixes for name in no_proxy.split(','): + name = name.strip() if name and (hostonly.endswith(name) or host.endswith(name)): return 1 # otherwise, don't bypass