[C-API] Weird sys.exc_info reference segfault

Jonas H. jonas at lophus.org
Wed Oct 6 09:23:55 EDT 2010


On 10/06/2010 02:01 PM, Antoine Pitrou wrote:
> It shouldn't. Are you sure you're calling PyType_Ready in the module
> initialization routine?

Yeah. The problem was that the type struct was declared 'static' in 
another module so the changes `PyType_Ready` made to the struct weren't 
applied correctly.

>
> By the way, it is recommended to use at least Py_TPFLAGS_DEFAULT for
> tp_flags.

Thanks, but I chose not to use that flags. I don't need any.

> tp_getattr has the same signature as PyObject_GetAttrString. You're
> looking for tp_getattro, which takes the attribute name as a PyObject *
> rather than as a char *.

Thanks again, my fault :-)

I think my problems are solved and my questions answered -- thank you so 
much for you patience!

Jonas



More information about the Python-list mailing list