From: Senthil Kumaran Date: Fri, 1 May 2009 06:00:23 +0000 (+0000) Subject: Fix for Issue1648102, based on the MSDN spec: If this parameter specifies the X-Git-Tag: v3.1b1~103 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4947606ecca1248bdfa9a71c7ea28239d0f64f56;p=python Fix for Issue1648102, based on the MSDN spec: If this parameter specifies the "" macro as the only entry, this function bypasses any host name that does not contain a period. --- diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 59ec7b826f..42e6d17206 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -2244,18 +2244,11 @@ elif os.name == 'nt': # '' string by the localhost entry and the corresponding # canonical entry. proxyOverride = proxyOverride.split(';') - i = 0 - while i < len(proxyOverride): - if proxyOverride[i] == '': - proxyOverride[i:i+1] = ['localhost', - '127.0.0.1', - socket.gethostname(), - socket.gethostbyname( - socket.gethostname())] - i += 1 - # print proxyOverride # now check if we match one of the registry values. for test in proxyOverride: + if test == '': + if '.' not in rawHost: + return 1 test = test.replace(".", r"\.") # mask dots test = test.replace("*", r".*") # change glob sequence test = test.replace("?", r".") # change glob char