Commit 08420fb9 authored by Jérome Perrin's avatar Jérome Perrin

fix unicodeconflictresolver that was causing the same error when logging the problematic text

parent eb779123
...@@ -35,7 +35,7 @@ def PreferredCharsetResolver_resolve(context, text, expression): ...@@ -35,7 +35,7 @@ def PreferredCharsetResolver_resolve(context, text, expression):
except UnicodeDecodeError, e: except UnicodeDecodeError, e:
tb_info = ''.join(traceback.format_stack()) tb_info = ''.join(traceback.format_stack())
logger.warn('UnicodeDecodeError: %s\ntext: %r\nat:\n%s' % logger.warn('UnicodeDecodeError: %s\ntext: %r\nat:\n%s' %
(e, text, tb_info)) (e, repr(text), tb_info))
result = unicode(text, 'utf-8', 'replace') result = unicode(text, 'utf-8', 'replace')
return result return result
PreferredCharsetResolver.resolve = PreferredCharsetResolver_resolve 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