bus error in Py_Finalize with ctypes imported

Robin robince at gmail.com
Fri Nov 13 15:27:23 CET 2009

On Nov 13, 2:14 pm, Robin <robi... at 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:

I will try the attached patch - hopefully it will make into a
forthcoming release.



More information about the Python-list mailing list