Problem with unpickling Numeric arrays

Johann Rohwer jm_rohwer at
Tue Aug 6 13:25:07 CEST 2002

I am unable to load pickles of Numeric arrays that have been saved to
files in binary format. Pickles that have been saved to files in ASCII
format work fine. Further, the problem only occurs with large arrays
(I have problems with a 3D array of dimension 2x101x16, whereas a
small 3x4x3 array works fine).

The error I get is the following:

>>> bin = open('restab','r')
>>> cPickle.load(bin)
Traceback (most recent call last):
  File "<pyshell#163>", line 1, in ?

The pickle was previously saved to a binary file 'restab':

>>> outfile = open('restab','w')
>>> cPickle.dump(array,outfile,1)
>>> outfile.close()

When omitting the binary "1" flag from the cPickle.dump statement,
everything works OK and I don't get the EOFError. As mentioned above,
the error also does not occur with a small array.

Anyone have ideas on what's going on?

Python version: 2.2.1
cPickle version: 1.71
OS: Win 2000

Johann Rohwer

More information about the Python-list mailing list