unicode decode error with UnicodeOption
This commit is contained in:
parent
2db15e193e
commit
1fba3394fe
@ -30,8 +30,15 @@ def display_list(lst, separator='and'):
|
|||||||
else:
|
else:
|
||||||
lst_ = []
|
lst_ = []
|
||||||
for l in lst[:-1]:
|
for l in lst[:-1]:
|
||||||
lst_.append(str(l))
|
if isinstance(l, unicode):
|
||||||
return ', '.join(lst_) + _(' {} ').format(separator) + str(lst[-1])
|
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
|
# Exceptions for an Option
|
||||||
|
Loading…
Reference in New Issue
Block a user