Skip to content

Commit

Permalink
fix: Use frappe.as_unicode to decode output of redis module list (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
marination committed Jun 8, 2022
1 parent fb4f8d8 commit 2832731
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion erpnext/e_commerce/redisearch_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2832731

Please sign in to comment.