pythonqt icon indicating copy to clipboard operation
pythonqt copied to clipboard

crashed when calling PythonQtObjectPtr::evalFile with a local disk file

Open f0ghua opened this issue 4 years ago • 1 comments

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?

f0ghua avatar May 15 '20 07:05 f0ghua

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.

iakov avatar Aug 04 '20 15:08 iakov