From fe379abb423aed13df7b3cf061f1845cdff52ee3 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Fri, 3 Feb 2017 15:56:00 +0100 Subject: [PATCH] display_list must return str, not unicode --- tiramisu/error.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tiramisu/error.py b/tiramisu/error.py index 8caf819..ac45751 100644 --- a/tiramisu/error.py +++ b/tiramisu/error.py @@ -26,7 +26,10 @@ def display_list(lst, separator='and'): if len(lst) == 0: return '' elif len(lst) == 1: - return lst[0] + ret = lst[0] + if isinstance(ret, unicode): + ret = ret.encode('utf8') + return ret else: lst_ = [] for l in lst[:-1]: