[QScintilla] dynamic module not initialized properly (qscintilla2 python binding)

Neal Becker ndbecker2 at gmail.com
Mon Dec 17 10:52:23 GMT 2007


On Monday 17 December 2007, Phil Thompson wrote:
> On Monday 17 December 2007, Neal Becker wrote:
> > I think I am on the track of the problem.
> > In sipQscicmodule.cpp:
> >
> > sipModule = Py_InitModule((char *)sipModuleAPI_Qsci.em_name,sip_methods);
> >
> > (gdb) p sipModuleAPI_Qsci.em_name
> > $7 = 0x2aaaaf889797 "PyQt4.Qsci"
> >
> > It was imported as "Qsci".  I'm thinking that PyQt4.Qsci != Qsci is why
> > we get the error here:
> >
> > In importdl.c:
> > 	m = PyDict_GetItemString(PyImport_GetModuleDict(), name);
> > 	if (m == NULL) {
> > 		PyErr_SetString(PyExc_SystemError,
> > 				"dynamic module not initialized properly");
>
> What's the context for all this? QScintilla and the Python bindings build
> without problems.
>

I figured it out.  Problem was that Qsci.so was installed into the wrong 
directory, so dlopen found it, but it was name 'Qsci' instead 
of 'PyQt4.Qsci'.

Too bad there isn't an easier way to detect this sort of error.


More information about the QScintilla mailing list