diff options
Diffstat (limited to 'iredis/client.py')
-rw-r--r-- | iredis/client.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/iredis/client.py b/iredis/client.py index bbdb87c..198d209 100644 --- a/iredis/client.py +++ b/iredis/client.py @@ -4,9 +4,10 @@ IRedis client. import re import os import sys +import codecs import logging from subprocess import run -from importlib_resources import read_text +from importlib.resources import read_text from packaging.version import parse as version_parse import redis @@ -282,6 +283,7 @@ class Client: connection.connect() logger.info(f"New connection created, retry on {connection}.") logger.info(f"send_command: {command_name} , {args}") + connection.send_command(command_name, *args) response = connection.read_response() except AuthenticationError: @@ -547,6 +549,12 @@ class Client: if command_name.upper() in ["ZSCAN", "ZPOPMAX", "ZPOPMIN"]: config.withscores = True + # TODO should we using escape_decode on all strings?? + if command_name.upper() == "RESTORE": + for i, a in enumerate(args): + serialized_value = codecs.escape_decode(a)[0] + args[i] = serialized_value + # not a tty if not completer: logger.warning( |