remove unicode decode error

This commit is contained in:
2017-01-19 21:38:16 +01:00
parent e2159fd307
commit f497e99002
8 changed files with 268 additions and 239 deletions

View File

@ -511,13 +511,16 @@ class Settings(object):
props, self, datas, opt_type)
else:
if len(props) == 1:
prop_msg = 'property'
prop_msg = _('property')
else:
prop_msg = 'properties'
prop_msg = _('properties')
name = opt_or_descr.impl_get_display_name()
if isinstance(name, unicode):
name = name.encode('utf8')
return PropertiesOptionError(_('cannot access to {0} "{1}" '
'because has {2} {3}'
'').format(opt_type,
opt_or_descr.impl_get_display_name(),
name,
prop_msg,
display_list(props)), props,
self, datas, opt_type)