msgpack-numpy icon indicating copy to clipboard operation
msgpack-numpy copied to clipboard

Python 2.7 broken on 0.4.8

Open KennyChenBasis opened this issue 1 year ago • 1 comments

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.

KennyChenBasis avatar Sep 14 '22 22:09 KennyChenBasis

Yeah, I'd prefer to drop support for Py2.7 at this point.

lebedov avatar Sep 15 '22 00:09 lebedov