From acd23e96512e9a2ed406f9c85e9f346fec3e93cd Mon Sep 17 00:00:00 2001 From: TheShadowOfHassen <94244235+TheShadowOfHassen@users.noreply.github.com> Date: Thu, 29 Dec 2022 16:07:31 -0500 Subject: [PATCH] Fixed error # #1095 (#1098) The error: TypeError: expected string or bytes-like object can be fixed by just a str to the line: return [(m.start(), m.end(), getSearchResultContext(text, m.start(), m.end())) for m in searchRegex.finditer(text)] --- manuskript/functions/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manuskript/functions/__init__.py b/manuskript/functions/__init__.py index 0d15af6..eb96253 100644 --- a/manuskript/functions/__init__.py +++ b/manuskript/functions/__init__.py @@ -469,7 +469,7 @@ def search(searchRegex, text): :return: list of tuples (startPos, endPos) """ if text is not None: - return [(m.start(), m.end(), getSearchResultContext(text, m.start(), m.end())) for m in searchRegex.finditer(text)] + return [(m.start(), m.end(), getSearchResultContext(text, m.start(), m.end())) for m in searchRegex.finditer(str(text))] else: return []