From 633a4521e496446dc3ae87752a412d94dddd563c Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Wed, 8 Jun 2022 18:12:02 +0530 Subject: [PATCH] fix: Use `frappe.as_unicode` to decode output of redis module list (backport #31282) (#31283) fix: Use `frappe.as_unicode` to decode output of redis module list (#31282) - As of redis 7, a list is added to the result of fetching the module list - This list cannot be "decoded",so use `frappe.as_unicode` that handles bytes as well as other types (cherry picked from commit 2832731601920b07c7083a20c49868e866640add) Co-authored-by: Marica --- erpnext/e_commerce/redisearch_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/e_commerce/redisearch_utils.py b/erpnext/e_commerce/redisearch_utils.py index f2dd796f2c57..97da02688ef4 100644 --- a/erpnext/e_commerce/redisearch_utils.py +++ b/erpnext/e_commerce/redisearch_utils.py @@ -38,7 +38,7 @@ def is_search_module_loaded(): out = cache.execute_command("MODULE LIST") parsed_output = " ".join( - (" ".join([s.decode() for s in o if not isinstance(s, int)]) for o in out) + (" ".join([frappe.as_unicode(s) for s in o if not isinstance(s, int)]) for o in out) ) return "search" in parsed_output except Exception: