pythonqt
pythonqt copied to clipboard
crashed when calling PythonQtObjectPtr::evalFile with a local disk file
I compiled PythonQt with mingw-g++ 7.3.0, and python 2.7 which I am not sure with the compiler(mostly it is vc). Everything works fine, except crashed when I tried to call PythonQtObjectPtr::evalFile like evalFile("example.py"). I googled and found this post, https://sourceforge.net/p/pythonqt/discussion/631393/thread/65f9a4af/, it seems a known issue but has not resolved. Any update on it? or any standard solution for this issue?
The origin of the problem is in FILE*
data structure. Python is compiled with MSVC and it has different assumptions about FILE
memory representation against MinGW's gcc.
This happens in the PythonQtImport::writeCompiledModule
, where corresponding Py_WriteXXX
methods which expect FILE*
are used.
One can use mingw's libpython
to workaround this. Probably, there are other solutions.