Try and encode logging messages. fix #403
This commit is contained in:
@@ -31,7 +31,7 @@ def toUnicode(original, *args):
|
||||
except:
|
||||
raise
|
||||
except UnicodeDecodeError:
|
||||
log.error('Unable to decode value: %s... ' % repr(original)[:20])
|
||||
log.error('Unable to decode value: %s... ', repr(original)[:20])
|
||||
ascii_text = str(original).encode('string_escape')
|
||||
return toUnicode(ascii_text)
|
||||
|
||||
|
||||
@@ -47,5 +47,5 @@ class RSS(object):
|
||||
try:
|
||||
return XMLTree.parse(data).findall(path)
|
||||
except Exception, e:
|
||||
log.error('Error parsing RSS. %s' % e)
|
||||
log.error('Error parsing RSS. %s', e)
|
||||
return []
|
||||
|
||||
@@ -118,10 +118,10 @@ def getTitle(library_dict):
|
||||
try:
|
||||
return library_dict['titles'][0]['title']
|
||||
except:
|
||||
log.error('Could not get title for %s' % library_dict['identifier'])
|
||||
log.error('Could not get title for %s', library_dict['identifier'])
|
||||
return None
|
||||
except:
|
||||
log.error('Could not get title for library item: %s' % library_dict)
|
||||
log.error('Could not get title for library item: %s', library_dict)
|
||||
return None
|
||||
|
||||
def randomString(size = 8, chars = string.ascii_uppercase + string.digits):
|
||||
|
||||
Reference in New Issue
Block a user