From 5adbafb046bfe3e5ecec3dc81e51ebb69a8af6c1 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Tue, 2 Mar 2021 18:16:57 -0500 Subject: [PATCH] bytes need bytes --- utils/story_functions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/story_functions.py b/utils/story_functions.py index ed221e44d..1e92fa89e 100644 --- a/utils/story_functions.py +++ b/utils/story_functions.py @@ -277,8 +277,8 @@ def truncate_chars(value, max_length): return value.decode('utf-8', 'ignore') truncd_val = value[:max_length] - if value[max_length] != " ": - rightmost_space = truncd_val.rfind(" ") + if value[max_length].decode() != " ": + rightmost_space = truncd_val.rfind(b" ") if rightmost_space != -1: truncd_val = truncd_val[:rightmost_space]