Commit 2bd817ff authored by Jérome Perrin's avatar Jérome Perrin

fixup! fix unicodeconflictresolver that was causing the same error when...

fixup! fix unicodeconflictresolver that was causing the same error when logging the problematic text
parent 95af3461
......@@ -34,8 +34,8 @@ def PreferredCharsetResolver_resolve(context, text, expression):
result = unicode(text, 'utf-8')
except UnicodeDecodeError, e:
tb_info = ''.join(traceback.format_stack())
logger.warn('UnicodeDecodeError: %s\ntext: %r\nat:\n%s' %
(e, repr(text), tb_info))
result = unicode(text, 'utf-8', 'replace')
logger.warn('UnicodeDecodeError(%s: %s): %s\ntext: %r\nat:\n%s' %
(e.start, e.end, e.reason, repr(text), tb_info))
result = unicode(text, 'utf-8', 'ignore')
return result
PreferredCharsetResolver.resolve = PreferredCharsetResolver_resolve
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment