pickle problem - frexp() out of range

A

ahaldar

Hi:

I have some large data structure objects in memory, and when I attempt
to pickle them, I get the following error:

SystemError: frexp() out of range

Are there some objects that are just too large to serialize, and if
so, is there an easy workaround without breaking up the object and
reconstructing it during deserialization?

Here's the code I use to pickle the object:

f = open(dir+file, "w+b")
pickle.dump(structure, f, protocol=2) # throws error
f.close()

- abhra
 
I

Irmen de Jong

ahaldar said:
Hi:

I have some large data structure objects in memory, and when I attempt
to pickle them, I get the following error:

SystemError: frexp() out of range

Are there some objects that are just too large to serialize, and if
so, is there an easy workaround without breaking up the object and
reconstructing it during deserialization?

Here's the code I use to pickle the object:

f = open(dir+file, "w+b")
pickle.dump(structure, f, protocol=2) # throws error
f.close()

- abhra

Could it be that your data contains floating point numbers,
where at least one of them is Inf or NaN?
I think these floats cannot be pickled reliably.

--Irmen
 
Z

Ziga Seilnacht

ahaldar said:
Hi:

I have some large data structure objects in memory, and when I attempt
to pickle them, I get the following error:

SystemError: frexp() out of range

Are there some objects that are just too large to serialize, and if
so, is there an easy workaround without breaking up the object and
reconstructing it during deserialization?

Here's the code I use to pickle the object:

f = open(dir+file, "w+b")
pickle.dump(structure, f, protocol=2) # throws error
f.close()

- abhra

You are probably trying to pickle Inf or NaN. This was fixed
in Python 2.5, see this revision:
http://svn.python.org/view?rev=38893&view=rev
and this patch:
http://www.python.org/sf/1181301

Ziga
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top