diff --git a/.bumpversion.cfg b/.bumpversion.cfg index c81c530..0baaf8e 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.13.1 +current_version = 1.13.2 commit = True tag = True diff --git a/CHANGELOG.md b/CHANGELOG.md index 49329ca..b6f62c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ ## UPCOMING +## 1.3.1 + +- Dependency: upgrade markdown render mistune to v3 +- Dependency: deprecated importlib_resources, use Python build in `importlib.resources` now +- Dependency: upgrade redis-py to 4.5 +- Doc: update homepage link to iredis.xbin.io +- Bugfix: Fix restore command caused by string literal escape + ## 1.3 - Dependency: Drop Python 3.6 support. diff --git a/README.md b/README.md index 11f3cb2..329ca42 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ like `KEYS *` (see config file. - Hide password for `AUTH` command. - Says "Goodbye!" to you when you exit! -- For full features, please see: [iredis.io](https://www.iredis.io) +- For full features, please see: [iredis.xbin.io](https://www.iredis.xbin.io) ## Install diff --git a/iredis/__init__.py b/iredis/__init__.py index 4b67c39..8d7257c 100644 --- a/iredis/__init__.py +++ b/iredis/__init__.py @@ -1 +1 @@ -__version__ = "1.13.1" +__version__ = "1.13.2" 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( diff --git a/iredis/commands.py b/iredis/commands.py index fcbe2a4..cf21a54 100644 --- a/iredis/commands.py +++ b/iredis/commands.py @@ -3,7 +3,7 @@ import csv import json import logging import functools -from importlib_resources import read_text, open_text +from importlib.resources import read_text, open_text from .utils import timer, strip_quote_args from .exceptions import InvalidArguments, AmbiguousCommand diff --git a/iredis/completers.py b/iredis/completers.py index e3ebb5a..6f9ecac 100644 --- a/iredis/completers.py +++ b/iredis/completers.py @@ -105,7 +105,6 @@ class TimestampCompleter(Completer): now = pendulum.now() for unit, minimum in self.when_lower_than.items(): if current <= minimum: - if self.future_time: dt = now.add(**{f"{unit}s": current}) offset_text = "later" diff --git a/iredis/config.py b/iredis/config.py index ea27827..ff31d4e 100644 --- a/iredis/config.py +++ b/iredis/config.py @@ -1,4 +1,4 @@ -from importlib_resources import path +from importlib.resources import path import os import logging diff --git a/iredis/markdown.py b/iredis/markdown.py index 6f26642..89297ec 100644 --- a/iredis/markdown.py +++ b/iredis/markdown.py @@ -30,7 +30,7 @@ class TerminalRender(mistune.HTMLRenderer): return super().heading(header_text, 2) return super().heading(self._to_title(text), level) - def list(self, body, ordered, level, start=None): + def list(self, body, ordered, *args, **kwargs): """Rendering list tags like ``