> > This kind of has me stymied. I don't call getJavaException()
> > anywhere, so it must be the call in jcc/jcc/cpp.py that's signalling this
> > exception, which means it's catching a JavaError which doesn't have
> > this method. How can that happen?
>
> I don't know. If you send me code to reproduce the problem, I can probably
> tell you more.
I recompiled with -g and ran under gdb. What's happening is that the line
in jcc/sources/functions.cpp:throwPythonError() that reads
PyErr_Fetch(&exc, &value, &traceback);
is returning, as "value", a Throwable, not a JavaError:
(gdb) p *value
$5 = {
ob_refcnt = 1,
ob_type = 0x139aa20
}
(gdb) p *value->ob_type
$6 = {
ob_refcnt = 42,
ob_type = 0x1f19a0,
ob_size = 0,
tp_name = 0x12d4e1d "Throwable",
tp_basicsize = 20,
tp_itemsize = 0,
tp_dealloc = 0x1006b90 <t_JObject_dealloc>,
tp_print = 0,
tp_getattr = 0,
tp_setattr = 0,
tp_compare = 0,
tp_repr = 0x1006f06 <t_JObject_repr>,
tp_as_number = 0x0,
tp_as_sequence = 0x0,
tp_as_mapping = 0x0,
tp_hash = 0x100704c <t_JObject_hash>,
tp_call = 0,
tp_str = 0x1006e58 <t_JObject_str>,
tp_getattro = 0x14bd8a <PyObject_GenericGetAttr>,
tp_setattro = 0x14c0fe <PyObject_GenericSetAttr>,
tp_as_buffer = 0x0,
tp_flags = 136683,
tp_doc = 0x12d4e27 "t_Throwable objects",
tp_traverse = 0,
tp_clear = 0,
tp_richcompare = 0x1006c86 <t_JObject_richcmp>,
tp_weaklistoffset = 0,
tp_iter = 0,
tp_iternext = 0,
tp_methods = 0x139aae0,
tp_members = 0x0,
tp_getset = 0x0,
tp_base = 0x1393de0,
tp_dict = 0x2eadb0,
tp_descr_get = 0,
tp_descr_set = 0,
tp_dictoffset = 0,
tp_init = 0x1052e80 <t_Throwable_init_>,
tp_alloc = 0x15cc2b <PyType_GenericAlloc>,
tp_new = 0x1006c06 <t_JObject_new>,
tp_free = 0x14d79a <PyObject_Free>,
tp_is_gc = 0,
tp_bases = 0x2eef70,
tp_mro = 0x476390,
tp_cache = 0x0,
tp_subclasses = 0x2b0f08,
tp_weaklist = 0x4763f0,
tp_del = 0
}
And Throwables don't have a "getJavaException" method.
It's being called from the generated _lucene code:
static jobject JNICALL t_PythonMultiFieldQueryParser_getBooleanQuery1(JNIEnv
*jenv, jobject jobj, jobject a0)
{
...
PyObject *result = PyObject_CallMethod(obj, "getBooleanQuery", "O", o0);
Py_DECREF(o0);
if (!result)
throwPythonError();
...
}
Bill
_______________________________________________
pylucene-dev mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev