problem using pickle / cPickle
Jesse Bloom
bloom at caltech.edu
Fri Jan 2 14:49:42 EST 2004
I keep running into a problem when I use pickle or cPickle to unpickle a
python object I have serialized from the database. I read the string
for the serialized object. Apparently I am missing an argument? Here's
what happens:
cPickle.loads(s)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: __new__() takes exactly 2 arguments (1 given)
Same thing happens when I use pickle:
>>> pickle.loads(s)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.3/pickle.py", line 1394, in loads
return Unpickler(file).load()
File "/usr/local/lib/python2.3/pickle.py", line 872, in load
dispatch[key](self)
File "/usr/local/lib/python2.3/pickle.py", line 1097, in load_newobj
obj = cls.__new__(cls, *args)
TypeError: __new__() takes exactly 2 arguments (1 given)
More information about the Python-list
mailing list