summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2010-06-27 13:59:39 (GMT)
committerRonald Oussoren <ronaldoussoren@mac.com>2010-06-27 13:59:39 (GMT)
commitb96fbb8d0058efa0b1b8d6adbe875488cb03e4fc (patch)
tree85c7b0b0a138a4ed8eb9214ba422142d355615d4
parent76002c8f1d9e367788fc55a4aa7685189416ebc6 (diff)
downloadcpython-b96fbb8d0058efa0b1b8d6adbe875488cb03e4fc.zip
cpython-b96fbb8d0058efa0b1b8d6adbe875488cb03e4fc.tar.gz
cpython-b96fbb8d0058efa0b1b8d6adbe875488cb03e4fc.tar.bz2
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.
-rw-r--r--Lib/urllib.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index de67f67..707e2f0 100644
--- a/Lib/urllib.py
+++ b/Lib/urllib.py
@@ -1383,8 +1383,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