problem using pickle / cPickle

J

Jesse Bloom

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:
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)
 
V

Vojin Jovanovic

Try it in Python 2.2.

Jesse Bloom said:
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:
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)
 

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,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top