<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<pre>Ah, that's pretty disappointing - I was hoping that Python would be 'tighter' than that. Although I appreciate the feedback - thank you.<br><br>As a follow up:<br><br>Since Python (at this time) cannot be cleanly re-initialized, would it be valid / sane to just create and destroy new sub-interpreters as needed?<br><br>So, instead of calling Py_Finalize() and Py_Initialize() to re-init Python, is it acceptable to use Py_NewInterpreter() and Py_EndInterpreter() <br>to achieve a similar effect? Barring the obvious bugs/caveats in the documentation, is there anything especially bad or wasteful about this?<br><br>I am also curious (and would appreciate a response) - how do the guys at CCP manage this type of situation? Or is it not a problem?<br><br>Thanks!<br><br>Mark Gants <br><br>---------- Forwarded message ----------<br>From: OvermindDL1 <overminddl1@gmail.com><br>Date: Sat, Feb 14, 2009 at 6:10 PM<br>Subject: Re: [Stackless] Cannot re-initialize Python<br>To: Richard Tew <richard.m.tew@gmail.com><br> <br>On Sat, Feb 14, 2009 at 8:17 AM, Richard Tew <richard.m.tew@gmail.com> wrote:<br>> On Sat, Feb 14, 2009 at 9:03 AM, Mark Gants <mgants4@hotmail.com> wrote:<br>>> I have embedded Stackless Python 2.6.1 into a C++ application of mine. At<br>>> certain points in the application I would like to 're-init' Python to clean<br>>> things up without having to shutdown and re-launch my application. First<br>>> time initializing Python works fine. I encounter a crash though when trying<br>>> to initialize Python a second time.<br>> ...<br>>> Does anyone know if this issue has been addressed in Stackless Python 3.0? I<br>>> would like to use v3.0, but chose v2.6.1 due to the warnings about bugs in<br>>> v3.0.<br>><br>> There is no reason to believe it would be fixed in 3.0, as no explicit<br>> fixes have been made for this.<br> <br>I ran into this myself long ago as well. As such I came up with the<br>fact that Python was not designed, nor will ever be designed to be<br>cleanly shutdown, it just will not clean up well, it expects the<br>program to shut down as soon as it shuts down, so the program shutdown<br>will clean the rest up. As such, it will never re-init well as well,<br>not without some major patching anyway.<br>It has nothing to do with Stackless though, this is a pure Python annoyance.</pre></body>
</html>