On Nov 13, 2:14 pm, Robin <robi...@gmail.com> wrote: > I am trying to embed Python in a MATLAB mex function. This is loaded > into the MATLAB interpreter - I would like the Python interpreter to > be initialized once and stay there for future calls. I added a call to > Py_Finalize as a mexAtExit handler which is called when the library is > unloaded in MATLAB (with clear funcname) or when MATLAB shuts down. So > far, things were working well, but I get a random but easily > repeatable bus error in Py_Finalize if I have imported ctypes.
Looks like I've run into this bug: http://bugs.python.org/issue6869 I will try the attached patch - hopefully it will make into a forthcoming release. Cheers Robin -- http://mail.python.org/mailman/listinfo/python-list