Skip to content

how to override decode_responses on a client instance when using a shared ConnectionPool #3715

@gshmu

Description

@gshmu

I'm opening this issue not to report a bug, but to suggest a documentation improvement based on a common point of confusion for users, including myself.

import redis

pool = redis.ConnectionPool(host='localhost', port=6379, db=0, decode_responses=True)

r_bytes = redis.Redis(connection_pool=pool, decode_responses=False)
key = 'my_binary_data'
poison_value = b'data-\x80-bytes'
r_bytes.set(key, poison_value)

r_bytes.get(key)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions