Python extension using threads cannot be used directly with PyInstaller

259 views
Skip to first unread message

Mathieu Virbel

unread,
May 31, 2012, 9:38:57 AM5/31/12
to pyins...@googlegroups.com
Hi guys,

I think i got an issue with custom extension that use Python threads.
I've a module bootstrap that contain python code using threads API.
If i do:
$ python
>>> import bootstrap
-> no crash, everything works.

But if i use PyInstaller, i got:
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6

After looking at the source/common/launch.c, it seem like the threads support is not initialized:
Py_Initialize(); is not, no PyEval_InitThreads();

Would it be possible to add it as an option somewhere ? By default, the python interpreter is doing it.

Mathieu

Martin Zibricky

unread,
May 31, 2012, 10:15:15 AM5/31/12
to pyins...@googlegroups.com
Could you fork pyinstaller submit a merge request?

That could make it clear what you exactly mean.

Is this the default behavior that should be available in pyinstaller?

Any code to reproduce this failure?

Mathieu Virbel píše v Čt 31. 05. 2012 v 06:38 -0700:

Mathieu Virbel

unread,
May 31, 2012, 2:57:59 PM5/31/12
to pyins...@googlegroups.com
Actually, it seem that my module crash as soon as Py_InitModule() is called. Dunno why yet. Adding the PyEval_InitThreads doesn't change anything. So i might be wrong on that one.
Will back after investigation.

Mathieu Virbel

unread,
May 31, 2012, 9:18:11 PM5/31/12
to pyins...@googlegroups.com
Ok, i found my error. It was due to some invalids flags during compilation. Now my module is working for both standalone python 32/64, or PyInstaller.

Sorry for the mess,

Mathieu
Reply all
Reply to author
Forward
0 new messages