celery / kombu

Messaging library for Python.
http://kombu.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
2.86k stars 926 forks source link

zlib doesn't support memoryview #909

Open Kronuz opened 6 years ago

Kronuz commented 6 years ago

When using Python 2.7.13, I'm getting the following:

body: <memory at 0x7f314a00acc8> (1016b)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/kombu/message.py", line 62, in _reraise_error
    reraise(*self.errors[0])
  File "/usr/local/lib/python2.7/site-packages/kombu/message.py", line 49, in __init__
    body = decompress(body, compression)
  File "/usr/local/lib/python2.7/site-packages/kombu/compression.py", line 70, in decompress
    return get_decoder(content_type)(body)
TypeError: decompress() argument 1 must be string or read-only buffer, not memoryview

The reason is zlib.decompress() doesn't (and neither does zlib.compress()) take memoryview.

georgepsarakis commented 6 years ago

Thanks for reporting this. Could you perhaps provide a code sample to reproduce this? Thanks.