[SciPy-dev] pickling problem

Darren Dale dd55 at cornell.edu
Thu Dec 1 08:24:14 CST 2005


Hi Travis,

On Wednesday 30 November 2005 16:03, Travis Oliphant wrote:
> Darren Dale wrote:
> >The following gives me the same error:
> >
> >import pickle
> >import scipy
> >import Numeric
> >
> >a = scipy.arange(10)
> >pickle.dump(a,file('temp.p','w'))
> >b = pickle.load(file('temp.p'))
> >c = Numeric.array(b)
> >
> >Traceback (most recent call last):
> >  File "pickletest.py", line 8, in ?
> >    c = Numeric.array(b)
> >ValueError: cannot handle misaligned or not writeable arrays.
>
> Which platform are you on?  Do you have an old version of Numeric
> getting picked up by accident?

I am using gentoo on a 64 bit Athlon, gcc-3.4.4, python-2.4.2. This morning, I 
removed Numeric, the rebuilt version 24.2 from scratch,  and still get the 
same error. Last night I tested the same scipy/Numeric combination on a 32 
bit system (gentoo, same gcc and python), and was not able to reproduce the 
error there.

> I can't seem to reproduce this error.
>
> This error will only show up in the array_fromstructinterface code which
> parses the array_struct interface information.
>
> What is the result of b.flags on your system?  To find out insert print
> b.flags right before you call Numeric.array.
>
> Mine is
>
> {'WRITEABLE': True, 'UPDATEIFCOPY': False, 'NOTSWAPPED': True,
> 'CONTIGUOUS': True, 'FORTRAN': True, 'ALIGNED': True, 'OWNDATA': False}
>
> In particular you are looking for WRITEABLE and ALIGNED to both be True.

mine is

{'WRITEABLE': True, 'UPDATEIFCOPY': False, 'NOTSWAPPED': True, 'CONTIGUOUS': 
True, 'FORTRAN': True, 'ALIGNED': False, 'OWNDATA': False}

Darren




More information about the Scipy-dev mailing list