C API PyObject_Call segfaults with string

Jen Kris jenkris at tutanota.com
Wed Feb 9 20:47:51 EST 2022


I'll do that and post back tomorrow.  The office is closing and I have to leave now (I'm in Seattle).  Thanks again for your help.  


Feb 9, 2022, 17:40 by songofacandy at gmail.com:

> On Thu, Feb 10, 2022 at 10:37 AM Jen Kris <jenkris at tutanota.com> wrote:
>
>>
>> I'm using Python 3.8 so I tried your second choice:
>>
>> pSents = PyObject_CallFunctionObjArgs(pSentMod, pListItem);
>>
>> but pSents is 0x0.  pSentMod and pListItem are valid pointers.
>>
>
> It means exception happened.
> If you are writing Python/C function, return NULL (e.g. `if (pSents ==
> NULL) return NULL`)
> Then Python show the exception and traceback for you.
>
> -- 
> Inada Naoki  <songofacandy at gmail.com>
>



More information about the Python-list mailing list