Skip to content

Exception: AttributeError: 'list' object has no attribute 'decode' #216

@faynburd

Description

@faynburd

Checklist

  • Python version 3.9.7
  • Using hiredis 2.0.0
  • Using uvloop 0.16.0
  • Does issue exists against the master branch of aredis? - yes

Steps to reproduce

From time to time we're getting error list' object has no attribute 'decode'
This is the stack
File "/usr/local/lib/python3.9/site-packages/aredis/commands/strings.py", line 210, in mset
return await self.execute_command('MSET', *items)
File "/usr/local/lib/python3.9/site-packages/aredis/client.py", line 156, in execute_command
return await self.parse_response(connection, command_name, **options)
File "/usr/local/lib/python3.9/site-packages/aredis/client.py", line 175, in parse_response
return callback(response, **options)
File "/usr/local/lib/python3.9/site-packages/aredis/utils.py", line 91, in bool_ok
return nativestr(response) == 'OK'
File "/usr/local/lib/python3.9/site-packages/aredis/utils.py", line 25, in nativestr
return x if isinstance(x, str) else x.decode('utf-8', 'replace')
AttributeError: 'list' object has no attribute 'decode'

Expected behavior

Not throwing exceptions on MSET command

Actual behavior

Throwing exception with the above stack - probably in some race or timeout/disconnect situation (pretty rare - once a 10K requests)

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