summaryrefslogtreecommitdiffstats
path: root/Lib/urllib.py
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2011-08-06 04:24:33 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2011-08-06 04:24:33 (GMT)
commitb5bd4c88b5de771647cc644b4e50e701cadba08c (patch)
treeff5f3f2ba2752817e33f174523ae7fe7645653ba /Lib/urllib.py
parent0f8acebd532645f888ce4cca83a45a2136b30ced (diff)
downloadcpython-b5bd4c88b5de771647cc644b4e50e701cadba08c.zip
cpython-b5bd4c88b5de771647cc644b4e50e701cadba08c.tar.gz
cpython-b5bd4c88b5de771647cc644b4e50e701cadba08c.tar.bz2
Fix closes issue12698 - make the no_proxy environment variable handling a bit lenient (accomodate spaces in between the items)
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r--Lib/urllib.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index aac235d..1261ec1 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -1366,7 +1366,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