From f39ad1f13a3fdc126e99bf3da45da1945f17e9c3 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Sat, 30 Apr 2016 07:45:51 -0700 Subject: [PATCH] Get rid of logentries.to_unicode. It wasn't doing anything that a literal couldn't do and used unicode_escape which only understands latin1 (The author of the code seems to have thought it took an encoding argument but it looks like that was silently ignored.) --- lib/ansible/plugins/callback/logentries.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/ansible/plugins/callback/logentries.py b/lib/ansible/plugins/callback/logentries.py index f5e80d3be7..d12d248900 100644 --- a/lib/ansible/plugins/callback/logentries.py +++ b/lib/ansible/plugins/callback/logentries.py @@ -78,10 +78,6 @@ except ImportError: from ansible.plugins.callback import CallbackBase -def to_unicode(ch): - return codecs.unicode_escape_decode(ch)[0] - - def is_unicode(ch): return isinstance(ch, unicode) @@ -106,7 +102,7 @@ class PlainTextSocketAppender(object): self.INVALID_TOKEN = ("\n\nIt appears the LOGENTRIES_TOKEN " "parameter you entered is incorrect!\n\n") # Unicode Line separator character \u2028 - self.LINE_SEP = to_unicode('\u2028') + self.LINE_SEP = u'\u2028' self.verbose = verbose self._conn = None