Clarify the error message

This commit is contained in:
Bo Maryniuk 2016-01-19 13:10:56 +01:00
parent 12f8e93247
commit a0f263f411

View file

@ -139,7 +139,7 @@ def info_installed(*names, **kwargs):
# Check, if string is encoded in a proper UTF-8
value_ = value.decode('UTF-8', 'ignore').encode('UTF-8', 'ignore')
if value != value_:
value = kwargs.get('errors', 'ignore') == 'ignore' and value_ or 'N/A (broken)'
value = kwargs.get('errors', 'ignore') == 'ignore' and value_ or 'N/A (invalid UTF-8)'
log.error('Package {0} has bad UTF-8 code in {1}: {2}'.format(pkg_name, key, value))
if key == 'source_rpm':
t_nfo['source'] = value