diff options
author | Senthil Kumaran <orsenthil@gmail.com> | 2009-05-01 05:59:52 +0000 |
---|---|---|
committer | Senthil Kumaran <orsenthil@gmail.com> | 2009-05-01 05:59:52 +0000 |
commit | 4af40d21737b073b09e491aa4923e2ae637817d7 (patch) | |
tree | b3f562200426749889f7ab64bb243ba76dde5b72 /Lib/urllib.py | |
parent | b01c6e53eda04039eb8c008ea837acdb334a2183 (diff) | |
download | cpython-git-4af40d21737b073b09e491aa4923e2ae637817d7.tar.gz |
Fix for Issue1648102, based on the MSDN spec: If this parameter specifies the
"<local>" macro as the only entry, this function bypasses any host name that
does not contain a period.
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r-- | Lib/urllib.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py index db2b49ec99..a56f16273a 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -1650,18 +1650,11 @@ elif os.name == 'nt': # '<local>' string by the localhost entry and the corresponding # canonical entry. proxyOverride = proxyOverride.split(';') - i = 0 - while i < len(proxyOverride): - if proxyOverride[i] == '<local>': - 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 == '<local>': + 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 |