[Stackless] cPickle should work?

Josh Ritter jritter at prairiegames.com
Tue May 2 03:55:29 CEST 2006


Hello,

I am running the 2.4.3 .dll binary on a Python 2.4.3 installation with the 
Lib folder downloaded from the svn repository.

Does the cPickle module work with Stackless?  The following code works if I 
use the pickle module, though fails when using cPickle with this traceback:

---------------------------------------------

Traceback (most recent call last):
  File "test.py", line 18, in ?
    pickledTasks = pickle.dumps(tasks)
TypeError: expected string or Unicode object, NoneType found

---------------------------------------------

from stackless import run, schedule, tasklet
import cPickle as pickle

def aCallable(name):
    print "  aCallable<%s>: Before schedule()" % (name,)
    schedule()
    print "  aCallable<%s>: After schedule()" % (name,)

tasks = []
for name in "ABCDE":
    tasks.append(tasklet(aCallable)(name))

print "Schedule 1:"
schedule()

print
print "Pickling..."
pickledTasks = pickle.dumps(tasks)

print
print "Schedule 2:"
schedule()

unpickledTasks = pickle.loads(pickledTasks)
for task in unpickledTasks:
    task.insert()
print
print "Schedule Unpickled Tasks:"
schedule()

-Josh Ritter
Prairie Games, Inc
http://www.prairiegames.com


_______________________________________________
Stackless mailing list
Stackless at stackless.com
http://www.stackless.com/mailman/listinfo/stackless



More information about the Stackless mailing list