Hi there,<br><br>I have written a server that contains stackless threads. When the server shuts down these threads are serialised to disk. This all happens without incident and I end up with a reasonably sized file per pickled object.<br>
<br>When I go to deserialise them I hit a problem. I get this...<br>-------------------<br>      File &quot;/home/cwellington/Development/yabi/yabi-be-twisted/trunk/TaskManager/Tasklets.py&quot;, line 54, in load<br>        task = pickle.loads(data)<br>
      File &quot;/usr/local/stackless/lib/python2.6/pickle.py&quot;, line 1415, in loads<br>        return Unpickler(file).load()<br>      File &quot;/usr/local/stackless/lib/python2.6/pickle.py&quot;, line 898, in load<br>
        dispatch[key](self)<br>      File &quot;/usr/local/stackless/lib/python2.6/pickle.py&quot;, line 1258, in load_build<br>        setstate(state)<br>    exceptions.TypeError: arg 5 (closure) expected cell, found stackless._wrap.cell<br>
--------------------<br><br>I think this might be a bug. The arguments are being passed back into the constructor of the stackless._wrap.function and the constructor is throwing that exception. So in essence, the __reduce__ or __reduce_ex__ functions are creating instatiation values that do not work on reinstantiation.<br>
<br>I changed pickle.py to print out some debug. setstate is... &lt;built-in method __setstate__ of stackless._wrap.function object at 0x21ca0c8&gt; and (state)[4] is... (&lt;cell at 0x2605f30: empty&gt;, &lt;cell at 0x2940718: list object at 0x259f518&gt;, &lt;cell at 0x2940670: str object at 0x2940768&gt;, &lt;cell at 0x2940750: str object at 0x29407d8&gt;, &lt;cell at 0x29407c0: int object at 0x25cd338&gt;)<br>
<br>These all seem to be &quot;cell&quot; objects. Why aren&#39;t they (stackless._wrap.cell) recognised as &quot;cells&quot;?<br><br>I can provide a pickletools.dis() dump of the pickle stream if wanted.<br><br>Using Stackless Python 2.6.2 on 64 bit linux (x86_64).<br>
<br>Can anybody help me decode my objects? or even find a way to encode them so the are decodable? Is this a bug, or am I doing it wrong?<br><br>Kind regards<br><br>Crispin Wellington<br>