]> granicus.if.org Git - python/commitdiff
Fix for Issue1648102, based on the MSDN spec: If this parameter specifies the
authorSenthil Kumaran <orsenthil@gmail.com>
Fri, 1 May 2009 05:59:52 +0000 (05:59 +0000)
committerSenthil Kumaran <orsenthil@gmail.com>
Fri, 1 May 2009 05:59:52 +0000 (05:59 +0000)
"<local>" macro as the only entry, this function bypasses any host name that
does not contain a period.

Lib/urllib.py

index db2b49ec99b11057030e4cdb4b003e5419497147..a56f16273ab122d906f1c0ef85e484ef4a8ad215 100644 (file)
@@ -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