Skip to content

int64 error #17

Description

@BorisMansencal

The following code does not work:

import numpy as np
from mmappickle import mmapdict

m = mmapdict("/tmp/test.mmdpickle")                                                                                                                                                              
a = np.array(1234, dtype=np.int64)
m['a'] = a

print("type m[a]=", type(m['a']))

I get the following error:

Traceback (most recent call last):
  File "/tmp/dbg.py", line 13, in <module>
    print("type m[a]=", type(m['a']))
  File "/usr/local/lib/python3.8/dist-packages/mmappickle/utils.py", line 53, in lock_wrapper
    return f(self, *a, **kw)
  File "/usr/local/lib/python3.8/dist-packages/mmappickle/dict.py", line 613, in __getitem__
    return pickler.read(data_offset, data_length)[0]
  File "/usr/local/lib/python3.8/dist-packages/mmappickle/utils.py", line 11, in save_file_position_wrapper
    return f(self, *a, **kw)
  File "/usr/local/lib/python3.8/dist-packages/mmappickle/picklers/numpy.py", line 115, in read
    assert False, "Invalid element type: 0x{:02x}".format(ord(shapeelementtype))
AssertionError: Invalid element type: 0x29

tested on Ubuntu 20.04 with python 3.8.10 and numpy 1.23.5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions