1
0
python-fakeredis/fakeredis-pr54-fix-ensure_str.patch
Dirk Mueller 3735292ed5 Accepting request 1009191 from home:bnavigator:branches:devel:languages:python
- Update to 1.9.3
  * Removed python-six dependency
  * zadd support for GT/LT by @cunla in #49
  * Remove six dependency by @cunla in #51
  * Add host to conn_pool_args by @cunla in #51
- Drop python-fakeredis-no-six.patch which was incomplete
  * all commits, including the missing ones in release now
- Add fakeredis-pr54-fix-ensure_str.patch

OBS-URL: https://build.opensuse.org/request/show/1009191
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fakeredis?expand=0&rev=19
2022-10-10 06:53:34 +00:00

28 lines
1.1 KiB
Diff

From 8db1b02b8649540b0d649bb884ca1ad9a9937677 Mon Sep 17 00:00:00 2001
From: Ben Greiner <code@bnavigator.de>
Date: Sun, 9 Oct 2022 21:35:45 +0200
Subject: [PATCH] Fix ensure_str
---
fakeredis/_fakesocket.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fakeredis/_fakesocket.py b/fakeredis/_fakesocket.py
index 71cc5e3..4452d32 100644
--- a/fakeredis/_fakesocket.py
+++ b/fakeredis/_fakesocket.py
@@ -1517,10 +1517,10 @@ def _convert_lua_result(self, result, nested=True):
return 1 if result else None
return result
- def ensure_str(self, s):
- return (s.decode(encoding='utf-8', errors='replace')
+ def ensure_str(self, s, encoding, replaceerr):
+ return (s.decode(encoding=encoding, errors=replaceerr)
if isinstance(s, bytes)
- else str(s).encode(encoding='utf-8', errors='replace'))
+ else str(s).encode(encoding=encoding, errors=replaceerr))
def _check_for_lua_globals(self, lua_runtime, expected_globals):
actual_globals = set(lua_runtime.globals().keys())