Issue 8883: Proxy exception lookup fails on MacOS in urllib. (original) (raw)

Created on 2010-06-03 07:31 by yorik.sar, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
urllib.py.diff yorik.sar,2010-06-03 07:31 patch
Messages (6)
msg106933 - (view) Author: Yuriy Taraday (yorik.sar) Date: 2010-06-03 07:31
I have straight IP in my proxy exception list like "192.168.0.2" 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.
msg106951 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2010-06-03 13:50
Patchs looks file, although the 'None' branch might be a bit too fancy. I haven't found a spec either, and therefore your code is probably the safest way to deduce a mask.
msg106952 - (view) Author: Yuriy Taraday (yorik.sar) Date: 2010-06-03 14:16
The strange thing is that in both 2.7 and 3.1 branches there is no such code at all. Inernet Config is used there without mentioning any exceptions despite the fact that ic module is marked as deprecated and proxy bypass is real.
msg106953 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2010-06-03 14:24
2.7 and 3.x use the SystemConfiguration framework (through the _scproxy extension)
msg106954 - (view) Author: Yuriy Taraday (yorik.sar) Date: 2010-06-03 14:33
I'm completely lost 2.7 tree in svn. My last post was about 3.1.2 release. As I understand, System Configuration framework is being used since 2.6.5 and 3.2. So, this bug is about all this versions.
msg108790 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2010-06-27 14:28
Committed the patch with some minor modifications in r82284 (2.7), r82285 (2.6), r82286 (3.2), r82287 (3.1)
History
Date User Action Args
2022-04-11 14:57:01 admin set github: 53129
2010-12-07 08:59:49 ned.deily link issue10643 superseder
2010-06-27 14:28:49 ronaldoussoren set status: open -> closedtype: crash -> behaviormessages: + resolution: fixedstage: resolved
2010-06-03 14:33:45 yorik.sar set messages: + versions: + Python 2.7, Python 3.2
2010-06-03 14:24:53 ronaldoussoren set messages: +
2010-06-03 14:16:37 yorik.sar set messages: +
2010-06-03 13:50:46 ronaldoussoren set assignee: ronaldoussorenmessages: + nosy: + ronaldoussoren
2010-06-03 07:31:48 yorik.sar create