[Stackless] Cannot re-initialize Python

Mark Gants mgants4 at hotmail.com
Sat Feb 14 15:03:23 CET 2009


I have embedded Stackless Python 2.6.1 into a C++ application of mine. At certain points in the application I would like to 're-init' Python to clean things up without having to shutdown and re-launch my application. First time initializing Python works fine. I encounter a crash though when trying to initialize Python a second time.

I am doing something like the following:

if (!Py_IsInitialized())
    Py_SetProgramName( /* some name */ );

// ...do some app stuff...

// ...and at some point...

if (Py_IsInitialized())
    // Try to re-initialize python
    Py_SetProgramName( /* some name */ );

    Py_Initialize();  // <--- Crashes here

I did some searching and found that I am having the same problem as described in these links:


Does anyone know if this issue has been addressed in Stackless Python 3.0? I would like to use v3.0, but chose v2.6.1 due to the warnings about bugs in v3.0.

Thank you, I appreciate it.


P.S. Sorry if this subject has already been discussed. I searched the list, but found no results.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.stackless.com/pipermail/stackless/attachments/20090214/4713b1b6/attachment.htm>

More information about the Stackless mailing list