display_list must return str, not unicode
authorEmmanuel Garette <egarette@cadoles.com>
Fri, 3 Feb 2017 14:56:00 +0000 (15:56 +0100)
committerEmmanuel Garette <egarette@cadoles.com>
Fri, 3 Feb 2017 14:56:00 +0000 (15:56 +0100)
tiramisu/error.py

index 8caf819..ac45751 100644 (file)
@@ -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]: