summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-02-18 23:10:23 (GMT)
committerGeorg Brandl <georg@python.org>2006-02-18 23:10:23 (GMT)
commit1f63670a2a0e66c049c2cfe8a2ec62a663e5c754 (patch)
tree1adfc0c20b33759e65dfee9159ca208201f4638e
parent4caeff9867dcc3fce66d4bb73199e2ef7bec62be (diff)
downloadcpython-1f63670a2a0e66c049c2cfe8a2ec62a663e5c754.zip
cpython-1f63670a2a0e66c049c2cfe8a2ec62a663e5c754.tar.gz
cpython-1f63670a2a0e66c049c2cfe8a2ec62a663e5c754.tar.bz2
Patch #1426648: urllib proxy_bypass broken
-rw-r--r--Lib/urllib.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index e1fa743..aeca3f1 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -1403,13 +1403,20 @@ elif os.name == 'nt':
if not proxyEnable or not proxyOverride:
return 0
# try to make a host list from name and IP address.
- host = [host]
+ rawHost, port = splitport(host)
+ host = [rawHost]
try:
- addr = socket.gethostbyname(host[0])
- if addr != host:
+ addr = socket.gethostbyname(rawHost)
+ if addr != rawHost:
host.append(addr)
except socket.error:
pass
+ try:
+ fqdn = socket.getfqdn(rawHost)
+ if fqdn != rawHost:
+ host.append(fqdn)
+ except socket.error:
+ pass
# make a check value list from the registry entry: replace the
# '<local>' string by the localhost entry and the corresponding
# canonical entry.