diff options
Diffstat (limited to 'pathod/log.py')
-rw-r--r-- | pathod/log.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pathod/log.py b/pathod/log.py index d39496e0..47837101 100644 --- a/pathod/log.py +++ b/pathod/log.py @@ -62,9 +62,15 @@ class LogCtx(object): for line in strutils.hexdump(data): self("\t%s %s %s" % line) else: - data = data.decode("ascii", "replace").replace(u"\ufffd", u".") - for i in strutils.escape_control_characters(data).split(u"\n"): - self(u"\t%s" % i) + data = strutils.native( + strutils.escape_control_characters( + data + .decode("ascii", "replace") + .replace(u"\ufffd", u".") + ) + ) + for i in data.split("\n"): + self("\t%s" % i) def __call__(self, line): self.lines.append(line) |