diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2023-11-04 18:52:16 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2023-11-04 18:52:16 +0000 |
commit | 61a3777eb82896afbb2472017210c7642751ecc2 (patch) | |
tree | fbd20f88f28005e6083560ba65e0194403aa3e42 /iredis/client.py | |
parent | Releasing debian version 1.13.1-1. (diff) | |
download | iredis-61a3777eb82896afbb2472017210c7642751ecc2.tar.xz iredis-61a3777eb82896afbb2472017210c7642751ecc2.zip |
Merging upstream version 1.14.0.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'iredis/client.py')
-rw-r--r-- | iredis/client.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/iredis/client.py b/iredis/client.py index bbdb87c..f7164b8 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 @@ -94,6 +95,7 @@ class Client: try: self.connection.connect() except Exception as e: + logger.exception("Can not create connection to server") print(str(e), file=sys.stderr) sys.exit(1) if not config.no_info: @@ -282,6 +284,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 +550,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( |