From ddb62e9f4c2a9efb707892b292b484e25c09db51 Mon Sep 17 00:00:00 2001 From: Ronald Oussoren Date: Sun, 27 Jun 2010 14:27:27 +0000 Subject: Merged revisions 82286 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r82286 | ronald.oussoren | 2010-06-27 16:26:30 +0200 (Sun, 27 Jun 2010) | 11 lines Merged revisions 82284 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r82284 | ronald.oussoren | 2010-06-27 15:59:39 +0200 (Sun, 27 Jun 2010) | 4 lines Fix for Issue8883: without this patch test_urllib will fail when there is a bare IP address in the "Bypass proxy settings for these Hosts & Domains" list on MacOSX. ........ ................ --- Lib/urllib/request.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index e85b65c..e59208f 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -2208,8 +2208,13 @@ if sys.platform == 'darwin': continue base = ip2num(m.group(1)) - mask = int(m.group(2)[1:]) - mask = 32 - mask + mask = m.group(2) + if mask is None: + mask = 8 * (m.group(1).count('.') + 1) + + else: + mask = int(mask[1:]) + mask = 32 - mask if (hostIP >> mask) == (base >> mask): return True -- cgit v0.12