[ale] python pickle data types

Jim Popovitch yahoo at jimpop.com
Wed Oct 24 16:50:07 EDT 2007


I've got a python problem, and Google isn't helping me much (could be
because I am looking for something much saner that what Google searches
suggest....)

I'm using an existing SWIG data type (from someone else's code+library)
like so:

	b = blahGetBigBlobOfData()
	with open('/tmp/buffer', 'wb') as f:
		pickle.dump(b,f)

When run, I get this error:

  File "/usr/lib/python2.5/copy_reg.py", line 69, in _reduce_ex
    raise TypeError, "can't pickle %s objects" % base.__name__
 TypeError: can't pickle PySwigObject objects


So I did a bunch of Google searches on the error, but none seem to
explain a straigh forward way to insert (possibly via type casting) a
non-standard data type into a pickle.

Any ideas?

Thanks!

-Jim P.



More information about the Ale mailing list