Hi there,<div><br></div><div>I recently got some errors pickling tasklets that I haven't got before. This is in version "Python 2.6.4 Stackless 3.1b3 060516". Ignore the strange pickle.py path, that's a copy of pickle.py that I dropped in to add some debug to try and find out what is happening. The traceback is:</div>
<div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre">  </span>  File "/usr/local/stackless/lib/python2.6/site-packages/twisted/internet/base.py", line 391, in fireEvent</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>    result = callable(*args, **kwargs)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>  File "/export/home/tech/cwellington/yabi/yabi-be-twisted/trunk/server.py", line 88, in shutdown</div><div><span class="Apple-tab-span" style="white-space:pre">  </span>    TaskManager.shutdown()</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>  File "/export/home/tech/cwellington/yabi/yabi-be-twisted/trunk/TaskManager/__init__.py", line 23, in shutdown</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>    tasklets.save(directory=config.config['backend']['tasklets'])</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>  File "/export/home/tech/cwellington/yabi/yabi-be-twisted/trunk/TaskManager/Tasklets.py", line 49, in save</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>    pickled_task = pickle.dumps(task,1)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>  File "/export/home/tech/cwellington/yabi/yabi-be-twisted/trunk/TaskManager/pickle.py", line 1403, in dumps</div><div><span class="Apple-tab-span" style="white-space:pre">       </span>    Pickler(file, protocol).dump(obj)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>  File "/export/home/tech/cwellington/yabi/yabi-be-twisted/trunk/TaskManager/pickle.py", line 232, in dump</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>    self.save(obj)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>  File "/export/home/tech/cwellington/yabi/yabi-be-twisted/trunk/TaskManager/pickle.py", line 340, in save</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>    self.save_reduce(obj=obj, *rv)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>  File "/export/home/tech/cwellington/yabi/yabi-be-twisted/trunk/TaskManager/pickle.py", line 428, in save_reduce</div><div><span class="Apple-tab-span" style="white-space:pre">  </span>    save(state)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>  File "/export/home/tech/cwellington/yabi/yabi-be-twisted/trunk/TaskManager/pickle.py", line 294, in save</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>    f(self, obj) # Call unbound method with explicit self</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>  File "/export/home/tech/cwellington/yabi/yabi-be-twisted/trunk/TaskManager/pickle.py", line 571, in save_tuple</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>    save(element)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>  File "/export/home/tech/cwellington/yabi/yabi-be-twisted/trunk/TaskManager/pickle.py", line 294, in save</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>    f(self, obj) # Call unbound method with explicit self</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>  File "/export/home/tech/cwellington/yabi/yabi-be-twisted/trunk/TaskManager/pickle.py", line 609, in save_list</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>    self._batch_appends(iter(obj))</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>  File "/export/home/tech/cwellington/yabi/yabi-be-twisted/trunk/TaskManager/pickle.py", line 642, in _batch_appends</div><div><span class="Apple-tab-span" style="white-space:pre">       </span>    save(x)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>  File "/export/home/tech/cwellington/yabi/yabi-be-twisted/trunk/TaskManager/pickle.py", line 315, in save</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>    rv = reduce(self.proto)</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>exceptions.ValueError: frame exec function at 00499ba0 is not registered!</div></div><div><br></div><div>The reduce function its calling from my debug turns out to be: <built-in method __reduce_ex__ of stackless.cframe object at 0x17d6a050>. (The proto is 1 btw)</div>
<div><br></div><div>I can keep digging myself, but does anyone have any experience with these kind of tasklet pickle problems? What is the 'normal' course of action when pickling a cFrame? What is the 'register' that the exec function needs to be entered into? Where does this happen? Can someone point me to info on how stackless pickles a tasklet with a cframe in it? Any help would be appreciated and I understand that this isn't much info. I'll keep digging!</div>
<div><br></div><div>Kind Regards</div><div><br></div><div>Crispin.</div>