Skip to content

Commit 742dd9f

Browse files
committed
Fix search for uncached entries (#323)
1 parent 717f89e commit 742dd9f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/search.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ def find_answers_by_keyword(directory, keyword, options="", request_options=None
103103
answer_dicts = get_answers(topic, request_options=request_options)
104104
for answer_dict in answer_dicts:
105105
answer_text = answer_dict.get('answer', '')
106+
# Temporary hotfix:
107+
# In some cases answer_text may be 'bytes' and not 'str'
108+
if type(b"") == type(answer_text):
109+
answer_text = answer_text.decode("utf-8")
110+
106111
if match(answer_text, keyword, options_dict=options_dict):
107112
answers_found.append(answer_dict)
108113

0 commit comments

Comments
 (0)