summaryrefslogtreecommitdiffstats
path: root/Lib/urllib
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2011-08-06 04:28:16 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2011-08-06 04:28:16 (GMT)
commit0c8108914ef70562f8ce4faaadf130fc9fb75ed2 (patch)
tree8de49e58158f3b753434d4a510b2baa9abcefa0f /Lib/urllib
parent4dc9c84ed9ad3a22d37abc06e53c450130bba317 (diff)
parent89976f1cdc49c909f808f8bb1ec15ac963acbc93 (diff)
downloadcpython-0c8108914ef70562f8ce4faaadf130fc9fb75ed2.zip
cpython-0c8108914ef70562f8ce4faaadf130fc9fb75ed2.tar.gz
cpython-0c8108914ef70562f8ce4faaadf130fc9fb75ed2.tar.bz2
merge from 3.2 - Fix closes issue12698 - make the no_proxy environment variable handling a bit lenient (accomodate spaces in between the items)
Diffstat (limited to 'Lib/urllib')
-rw-r--r--Lib/urllib/request.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index d1acae1..4a571e8 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -2274,7 +2274,8 @@ def proxy_bypass_environment(host):
# strip port off host
hostonly, port = splitport(host)
# check if the host ends with any of the DNS suffixes
- for name in no_proxy.split(','):
+ no_proxy_list = [proxy.strip() for proxy in no_proxy.split(',')]
+ for name in no_proxy_list:
if name and (hostonly.endswith(name) or host.endswith(name)):
return 1
# otherwise, don't bypass