Skip to content

AttributeError: 'list' object has no attribute 'encode' (no support for multi-bulk reply to SUBSCRIBE command) #612

@marc1n

Description

@marc1n

From time to time I get error:

redis_client = redis.StrictRedis.from_url('redis://localhost:6379/0')
pubsub = redis_client.pubsub()
for message in pubsub.listen():
    # ...

Traceback (most recent call last):

 [...]
  File "<MYDIR>/local/lib/python2.7/site-packages/redis/client.py", line 2215, in listen
    response = self.handle_message(self.parse_response(block=True))
  File "<MYDIR>/local/lib/python2.7/site-packages/redis/client.py", line 2232, in handle_message
    message_type = nativestr(response[0])
  File "<MYDIR>/local/lib/python2.7/site-packages/redis/_compat.py", line 19, in <lambda>
    x if isinstance(x, str) else x.encode('utf-8', 'replace')
AttributeError: 'list' object has no attribute 'encode'

Version: redis (2.10.3)

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