<div dir="ltr">Two things:<div><br></div><div> - Just guessing: Is it something in copying the closure of self.func2 that triggers the pickling of modules?</div><div> - With '<span style="font-family:arial,sans-serif;font-size:13px">any mechanism for excluding values from a pickle', do you mean __getstate__/__reduce__?</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">The latter could probably provide a workaround, but also more administration that would only be needed during debug runs.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Cheers, Lars</span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Oct 23, 2013 at 5:06 PM, John Ehresman <span dir="ltr"><<a href="mailto:jpe@wingware.com" target="_blank">jpe@wingware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 10/23/13 6:00 AM, <a href="mailto:stackless-request@stackless.com" target="_blank">stackless-request@stackless.<u></u>com</a> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: Christian Tismer<<a href="mailto:tismer@stackless.com" target="_blank">tismer@stackless.com</a>><div class="im"><br>
<br>
well, this is something for WingWare. Or you can work around it.<br>
<br>
When certain things happen, like pickling, the Wind IDE needs to<br>
return the original objects, by either releasing its hooks, or<br>
by pretending they do. No idea how difficult that is.<br>
</div></blockquote>
<br>
This may be, but what I don't understand is that the example provided pickles an instance of a class.  The traceback indicates that the module global dictionary is also being pickled and this fails because there is an import hook that is calls into the debugger.  It seems odd to me to pickle the globals in this case -- my expectation is when the instance was unpickled code would refer to the current globals, not a copy of the globals from when the instance was pickled.<br>

<br>
It does look like the __init__ saves a reference of self.func2 in self.func -- is this what triggers the pickling of globals?<br>
<br>
Is there any mechanism for excluding values from a pickle?  The import hook and other debugger callbacks probably should not be pickled. Pickles created when the debugger is running should be unpicklable when it is not running and vice versa.<br>

<br>
Thanks,<br>
<br>
John<div class="HOEnZb"><div class="h5"><br>
<br>
______________________________<u></u>_________________<br>
Stackless mailing list<br>
<a href="mailto:Stackless@stackless.com" target="_blank">Stackless@stackless.com</a><br>
<a href="http://www.stackless.com/mailman/listinfo/stackless" target="_blank">http://www.stackless.com/<u></u>mailman/listinfo/stackless</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>====================================<br>Lars van Gemerden<br><a href="mailto:lars@rational-it.com">lars@rational-it.com</a><br>+31 6 26 88 55 39<br>
====================================
</div>