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:
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user