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 2832731601)

Co-authored-by: Marica <maricadsouza221197@gmail.com>
This commit is contained in:
mergify[bot]
2022-06-08 18:12:02 +05:30
committed by GitHub
parent 8a4c9d1238
commit 633a4521e4

View File

@@ -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: