Skip to content

decode_responses=True doesn't work #97

@pbecotte

Description

@pbecotte

Setting decode_responses on the client should cause the client to return strings instead of bytes objects in python 3.

Python 3.5.0 (default, Oct 24 2015, 09:48:42) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from mockredis import mock_strict_redis_client
>>> 
>>> redis = mock_strict_redis_client(decode_responses=True)
>>> redis.set('yo', 'hello')
True
>>> redis.get('yo')
b'hello'
Python 3.4.3 (default, Oct 14 2015, 20:28:29) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from redis import StrictRedis
>>> r = StrictRedis('redis')
>>> r.set('yo', 'hello')
True
>>> r.get('yo')
b'hello'
>>> r = StrictRedis('redis', decode_responses=True)
>>> r.get('yo')
'hello'

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