[issue8883] Proxy exception lookup fails on MacOS in urllib.

Yuriy Taraday report at bugs.python.org
Thu Jun 3 09:31:49 CEST 2010

New submission from Yuriy Taraday <yorik.sar at gmail.com>:

I have straight IP in my proxy exception list like "" without mask specification.

The proxy_bypass_macosx_sysconf function verifies each item in this list by regexp r"(\d+(?:\.\d+)*)(/\d+)?" that produces two groups: IP and mask. The mask can be None here (as in my case) and this None case isn't handled, so urllib crashes with "TypeError: 'NoneType' object is unsubscriptable".

I couldn't find specification of MacOS proxy exceptions list, so I don't know whether you can use just IP or prefix without mask specification. If you can, here is small patch that adds nesessary check and guesses mask if it is not specified. If you cannot, the last question mark should be removed from regex.

components: Library (Lib)
files: urllib.py.diff
keywords: patch
messages: 106933
nosy: yorik.sar
priority: normal
severity: normal
status: open
title: Proxy exception lookup fails on MacOS in urllib.
type: crash
versions: Python 2.6
Added file: http://bugs.python.org/file17526/urllib.py.diff

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list