Try and encode logging messages. fix #403

This commit is contained in:
Ruud
2012-06-11 12:38:22 +02:00
parent 9cb4d8842c
commit e0440d4b11
59 changed files with 274 additions and 259 deletions
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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 []
+2 -2
View File
@@ -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):