summaryrefslogtreecommitdiff
path: root/redis/asyncio/cluster.py
diff options
context:
space:
mode:
authorShay Fadida <shayfadida@gmail.com>2022-11-09 14:22:27 +0200
committerGitHub <noreply@github.com>2022-11-09 14:22:27 +0200
commitfb647430f00cc7bb67c978e75f2dabc661567779 (patch)
tree009cd0ab1bde4d4bcbaab5711079c04aab0eda74 /redis/asyncio/cluster.py
parent772079fabd7453edf3788d0c31b9caf21ff5deca (diff)
downloadredis-py-fb647430f00cc7bb67c978e75f2dabc661567779.tar.gz
Fix special response parsing options handling (#2302)
* Fix special response parsing options handling When using special response parsing options like `NEVER_DECODE` and `EMPTY_RESPONSE`, don't pass them to the response callbacks because some of them are not prepared for receiving named arguments. Instead, redis-py should use them before calling the callbacks and then discard them. * Use kwargs instead of options * change options to kwargs in asyncio/cluster.py/L878 Co-authored-by: Chayim <chayim@users.noreply.github.com> Co-authored-by: dvora-h <67596500+dvora-h@users.noreply.github.com>
Diffstat (limited to 'redis/asyncio/cluster.py')
-rw-r--r--redis/asyncio/cluster.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/redis/asyncio/cluster.py b/redis/asyncio/cluster.py
index 8abb072..97f4151 100644
--- a/redis/asyncio/cluster.py
+++ b/redis/asyncio/cluster.py
@@ -934,6 +934,7 @@ class ClusterNode:
try:
if NEVER_DECODE in kwargs:
response = await connection.read_response(disable_decoding=True)
+ kwargs.pop(NEVER_DECODE)
else:
response = await connection.read_response()
except ResponseError:
@@ -941,6 +942,9 @@ class ClusterNode:
return kwargs[EMPTY_RESPONSE]
raise
+ if EMPTY_RESPONSE in kwargs:
+ kwargs.pop(EMPTY_RESPONSE)
+
# Return response
if command in self.response_callbacks:
return self.response_callbacks[command](response, **kwargs)