jd-boyd/python-lzo

Support Python Memory Views

lehanesa opened this issue · 2 comments

Python 3.8 introduces a new shared memory module for multiprocessing. The buffer is available as a python memory view.

Rather than copying the data to a new byte like object for decompression it would be great if we can pass the memory view directly. This would greatly improve the decompression when working with memory views. Currently it produces the error:

"argument 1 must be read-only bytes-like object, not memoryview"

I would love to see a pull request to support this. However, at the moment it would also need to continue to support python 2.6, 2.7 and the 3.x back to 3.3.

I got

TypeError: argument 1 must be read-only bytes-like object, not bytearray

I use bytearray because I've to serialize some data structure at runtime.

Some packages have dropped python 2.7 support in new release.
Ubuntu 20.04 have removed python2.
And some linux distribution have linked python command to /usr/bin/python3.
It's time to say goodbye to python2.