From: Georg Brandl Date: Sat, 18 Feb 2006 23:10:23 +0000 (+0000) Subject: Patch #1426648: urllib proxy_bypass broken X-Git-Tag: v2.5a0~609 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1f63670a2a0e66c049c2cfe8a2ec62a663e5c754;p=thirdparty%2FPython%2Fcpython.git Patch #1426648: urllib proxy_bypass broken --- diff --git a/Lib/urllib.py b/Lib/urllib.py index e1fa743828c7..aeca3f100734 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 # '' string by the localhost entry and the corresponding # canonical entry.