[issue8095] test_urllib2 crashes on OS X 10.3 attempting to retrieve network proxy configuration
Ronald Oussoren
report at bugs.python.org
Tue Mar 9 11:09:06 CET 2010
Ronald Oussoren <ronaldoussoren at mac.com> added the comment:
I don't have a 10.3 system to test on, and definitely don't want to spent effort on enabling compiles on 10.3
The patch below would probably fix the crash when running a binary created on 10.4 or later on osx 10.3:
Index: ../Mac/Modules/_scproxy.c
===================================================================
--- ../Mac/Modules/_scproxy.c (revision 78807)
+++ ../Mac/Modules/_scproxy.c (working copy)
@@ -64,13 +64,18 @@
result = PyDict_New();
if (result == NULL) goto error;
- aNum = CFDictionaryGetValue(proxyDict,
+ if (kSCPropNetProxiesExcludeSimpleHostnames != NULL) {
+ aNum = CFDictionaryGetValue(proxyDict,
kSCPropNetProxiesExcludeSimpleHostnames);
- if (aNum == NULL) {
- v = PyBool_FromLong(0);
- } else {
- v = PyBool_FromLong(cfnum_to_int32(aNum));
+ if (aNum == NULL) {
+ v = PyBool_FromLong(1);
+ } else {
+ v = PyBool_FromLong(cfnum_to_int32(aNum));
+ }
+ } else {
+ v = PyBool_FromLong(1);
}
+
if (v == NULL) goto error;
r = PyDict_SetItemString(result, "exclude_simple", v);
The patch hasn't been compiled yet, but the idea should be clear: test if kSCPropNetProxiesExcludeSimpleHostnames has a valid value before using it, default to 'True'.
(This also changes the default on 10.4/10.5, IMHO defaulting to true would be better: I haven't seen an enviroment yet where local systems should be accessed through a proxy).
BTW. Removing 3.1 and 3.2 because _scproxy isn't in those releases yet (mostly because porting requires signifant changes to the C code and I haven't had time to do that yet)
----------
versions: -Python 3.1, Python 3.2
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8095>
_______________________________________
More information about the Python-bugs-list
mailing list