decode_responses in StrictRedis ignored when using ConnectionPool
See original GitHub issue>>> import redis
>>> p = redis.ConnectionPool()
>>> r = redis.StrictRedis(connection_pool=p, decode_responses=True)
>>> r.set('key', 'value')
True
>>> r.get('key')
b'value' # should be just value (unicode instead of bytes)
I am aware that the problem arises from ConnectionPool
passing its’ own arguments to Connection
, which is why some would say it is desired behaviour. On the other hand I don’t understand why the parser is created per Connection
, not per client - wouldn’t it actually solve the issue?
Thanks.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
decode_responses in StrictRedis ignored when ... - GitHub
I am aware that the problem arises from ConnectionPool passing its' own arguments to Connection , which is why some would say it...
Read more >Source code for redis.client - redis-py's documentation!
Based on configuration, an instance will either use a ConnectionPool, or Connection object to talk to redis. It is not safe to pass...
Read more >How to use connection pooling for redis.StrictRedis?
Each Redis instance that you create in turn all instances will create their own connection pool.You can overwrite this behaviour by using ......
Read more >redis-py · master · Sampa / Redis · GitLab
The master and slave objects are normal StrictRedis instances with their connection pool bound to the Sentinel instance. When a Sentinel backed client...
Read more >redis.client — TaskFlow documentation
If using the redis:// scheme, the path argument of the url, ... arguments will be passed along to the ConnectionPool class's initializer.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This continues to work as intended. If you’re creating your own Connection Pool instance, you need to provide all connection options, including
decode_responses
, to theConnectionPool
. You can do this either by passing those options directly toConnectionPool.__init__()
or via a connection URL.If you supply the
connection_pool
argument to theRedis
class, all other connection options to theRedis
class are ignored.Up. Still troubles.