Python Pickling Issue

B

Brandon Harris

I have written a fairly large DAG with python and I've run into an issue
when attempting to pickle the data to disk.
It will pickle fine the first time, but if I call pickle again, it
throws this error.

/usr/lib64/python2.6/copy_reg.py in _reduce_ex(self, proto)
68 else:
69 if base is self.__class__:
---> 70 raise TypeError, "can't pickle %s objects" %
base.__name__
71 state = base(self)
72 args = (self.__class__, base, state)

TypeError: can't pickle function objects

I'm calling
save_file = open('my_file.rsf', 'w')
cPickle.dump(self, save_file)

I have attempted to pickle the object to a different file after the
first time, but the error is still thrown.

This wouldn't be very hard to track down if the error gave any
indication as to where or what this function it can't pickle is, so
if there's any possible way to at least get the name of what's failing
to be pickled, that would be a win.

Thanks in advance for all replies.

Brandon L. Harris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top