Non portable ndarray serialization

Issue #54 new
Yury Zotov created an issue

It is impossible to pickle ndarray in PyPy and load it in Python.

# dump in PyPy
a = numpy.array([[1,2],[3,4]])
with open('a.pkl', 'wb') as f:
    cPickle.dump(a, f)
# load in Python
with open('a.pk', 'rb') as f:
    a = cPickle.load(f)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named _numpypy.multiarray

In opposite direction works well.

Comments (1)

  1. mattip

    Work on this has begun on the numpypy_pickle_compat branch. Still to do::

    • go through all the existing calls to dumps in tests and add "assert '_numpypy' not in data"
    • add strucs and binascii to all the usemodules = [] in test class definitions
    • add tests for scalars
    • make it all work :)
  2. Log in to comment