I saw some posts in the archives for the same problem I ran into, so I
figured I'd forward a patch off that fixes the problem in clearsilver
that causes it to segfault on python 2.5
It probably could use a cleanup, but it works for me atleas.t
That patch was originally developed against 0.10.1 that I had installed,
but it works fine with 0.10.3 now that I've upgraded to it.
JE
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Trac Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---
diff -ur clearsilver-0.10.1.orig/python/Makefile
clearsilver-0.10.1/python/Makefile
--- clearsilver-0.10.1.orig/python/Makefile 2005-06-30 11:51:55.000000000
-0700
+++ clearsilver-0.10.1/python/Makefile 2006-11-07 12:43:59.000000000 -0800
@@ -20,7 +20,7 @@
else
TARGETS = $(NEO_UTIL_SO)
endif
-
+PYTHON=python
all: $(TARGETS)
$(NEO_UTIL_SO): setup.py $(NEO_UTIL_SRC) $(DEP_LIBS)
diff -ur clearsilver-0.10.1.orig/python/neo_cgi.c
clearsilver-0.10.1/python/neo_cgi.c
--- clearsilver-0.10.1.orig/python/neo_cgi.c 2005-06-30 18:30:18.000000000
-0700
+++ clearsilver-0.10.1/python/neo_cgi.c 2006-11-07 12:54:47.000000000 -0800
@@ -49,6 +49,12 @@
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
};
static void p_cgi_dealloc (CGIObject *ho)
@@ -57,7 +63,7 @@
{
cgi_destroy (&(ho->cgi));
}
- PyMem_DEL(ho);
+ ho->ob_type->tp_free((PyObject *)ho);
}
PyObject * p_cgi_to_object (CGI *data)
@@ -71,7 +77,7 @@
}
else
{
- CGIObject *ho = PyObject_NEW (CGIObject, &CGIObjectType);
+ CGIObject *ho = PyObject_New (CGIObject, &CGIObjectType);
if (ho == NULL) return NULL;
ho->cgi = data;
ho->hdf = p_hdf_to_object (data->hdf, 0);
@@ -919,8 +925,9 @@
static void *NEO_PYTHON_API[P_NEO_CGI_POINTERS];
PyObject *c_api_object;
- CGIObjectType.ob_type = &PyType_Type;
-
+ CGIObjectType.tp_new = PyType_GenericNew;
+ if (PyType_Ready(&CGIObjectType) < 0)
+ return;
initneo_util();
diff -ur clearsilver-0.10.1.orig/python/neo_cs.c
clearsilver-0.10.1/python/neo_cs.c
--- clearsilver-0.10.1.orig/python/neo_cs.c 2005-06-30 11:51:56.000000000
-0700
+++ clearsilver-0.10.1/python/neo_cs.c 2006-11-07 12:54:36.000000000 -0800
@@ -45,6 +45,12 @@
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
};
static void p_cs_dealloc (CSObject *ho)
@@ -54,7 +60,7 @@
{
cs_destroy (&(ho->data));
}
- PyMem_DEL(ho);
+ ho->ob_type->tp_free((PyObject *)ho);
}
PyObject * p_cs_to_object (CSPARSE *data)
@@ -68,7 +74,7 @@
}
else
{
- CSObject *ho = PyObject_NEW (CSObject, &CSObjectType);
+ CSObject *ho = PyObject_New (CSObject, &CSObjectType);
if (ho == NULL) return NULL;
ho->data = data;
rv = (PyObject *) ho;
@@ -180,7 +186,9 @@
{
PyObject *m, *d;
- CSObjectType.ob_type = &PyType_Type;
+ CSObjectType.tp_new = PyType_GenericNew;
+ if (PyType_Ready(&CSObjectType) < 0)
+ return;
m = Py_InitModule("neo_cs", ModuleMethods);
d = PyModule_GetDict(m);
diff -ur clearsilver-0.10.1.orig/python/neo_util.c
clearsilver-0.10.1/python/neo_util.c
--- clearsilver-0.10.1.orig/python/neo_util.c 2005-06-30 11:51:56.000000000
-0700
+++ clearsilver-0.10.1/python/neo_util.c 2006-11-07 12:55:29.000000000
-0800
@@ -66,6 +66,12 @@
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_as_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
};
@@ -76,7 +82,7 @@
{
hdf_destroy (&(ho->data));
}
- PyMem_DEL(ho);
+ ho->ob_type->tp_free((PyObject *)ho);
}
PyObject * p_hdf_to_object (HDF *data, int dealloc)
@@ -90,7 +96,7 @@
}
else
{
- HDFObject *ho = PyObject_NEW (HDFObject, &HDFObjectType);
+ HDFObject *ho = PyObject_New (HDFObject, &HDFObjectType);
if (ho == NULL) return NULL;
ho->data = data;
ho->dealloc = dealloc;
@@ -697,7 +703,9 @@
{
PyObject *m, *d;
- HDFObjectType.ob_type = &PyType_Type;
+ HDFObjectType.tp_new = PyType_GenericNew;
+ if (PyType_Ready(&HDFObjectType) < 0)
+ return;
m = Py_InitModule("neo_util", UtilMethods);
d = PyModule_GetDict(m);