No need to decode

This commit is contained in:
Samuel Clay 2021-03-02 18:33:00 -05:00
parent 7dcfea68fb
commit 94e27a1f7b

View file

@ -277,7 +277,7 @@ def truncate_chars(value, max_length):
return value.decode('utf-8', 'ignore')
truncd_val = value[:max_length]
if value[max_length].decode() != " ":
if value[max_length] != b" ":
rightmost_space = truncd_val.rfind(b" ")
if rightmost_space != -1:
truncd_val = truncd_val[:rightmost_space]