diff --git a/tiramisu/error.py b/tiramisu/error.py index 04d94ae..8caf819 100644 --- a/tiramisu/error.py +++ b/tiramisu/error.py @@ -30,8 +30,15 @@ def display_list(lst, separator='and'): else: lst_ = [] for l in lst[:-1]: - lst_.append(str(l)) - return ', '.join(lst_) + _(' {} ').format(separator) + str(lst[-1]) + if isinstance(l, unicode): + l = l.encode('utf8') + elif not isinstance(l, str): + l = str(l) + lst_.append(l) + last = lst[-1] + if isinstance(last, unicode): + last = last.encode('utf8') + return ', '.join(lst_) + _(' {} ').format(separator) + last # Exceptions for an Option