when calling ubus_python_add it will segmentation fault at PyArg_ParseTupleAndKeywords()
Sorry for my bad English first,
as title, in my platform , when i calling ubus.add(...)
it will segmentation fault ,
and i found it will stop at
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OO", kwlist, &object_name, &methods)){
...
}
and i try to fix it, then i found
in the python method define the argument, if we change it from
{"add", (PyCFunction)ubus_python_add, METH_VARARGS, connect_add_doc}
to
{"add", (PyCFunction)ubus_python_add, METH_VARARGS|MTEH_KEYWORDs, connect_add_doc}
and it will no more segmentation fault anymore.
is this a bug or something?
this is my first time to write/modify/fixing from C code to Python module
so , i'm not sure my way is correct
after
ubus.add(
"my_object", {
"my_method": {"method": callback, "signature": {
"first": ubus.BLOBMSG_TYPE_STRING,
}},
},
)
i'm using ubus cli to call my python callback
and it cause other segmentation fault ...
i will keep working on that
or if you have any advise
please tell me
thank you.
BTW. other function is work fine (call, send connect , listen ... etc) only 'add' have some issues