Skip to content

Python 2.7 broken on 0.4.8 #51

@KennyChenBasis

Description

@KennyChenBasis

The commit to handle object arrays broke Python 2.7 support for object and void arrays:

Traceback (most recent call last):
  File "tests.py", line 259, in test_numpy_structured_array
    x_rec = self.encode_decode(x)
  File "tests.py", line 30, in encode_decode
    x_enc = msgpack.packb(x)
  File "/home/user/git/msgpack-numpy/msgpack_numpy.py", line 269, in packb
    return Packer(**kwargs).pack(o)
  File "/home/user/git/msgpack-numpy/.tox/py27/lib/python2.7/site-packages/msgpack/fallback.py", line 883, in pack
    self._pack(obj)
  File "/home/user/git/msgpack-numpy/.tox/py27/lib/python2.7/site-packages/msgpack/fallback.py", line 872, in _pack
    obj = self._default(obj)
  File "/home/user/git/msgpack-numpy/msgpack_numpy.py", line 63, in encode
    kind = bytes(obj.dtype.kind, 'ascii')
TypeError: str() takes at most 1 argument (2 given)

On the other hand, it might be time to drop support for Python 2 and old msgpack versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions