From b137fa5fb39ab7ada15aaaaece081d683149ace5 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 13 Jan 2013 10:23:08 -0500 Subject: [PATCH] script-publish.py: Don't print raw strings to the log Print their repr() instead, since the strings may contain funky characters and missed control codes. --- posts/script/script-publish.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/posts/script/script-publish.py b/posts/script/script-publish.py index ea47b2c..4f750e4 100755 --- a/posts/script/script-publish.py +++ b/posts/script/script-publish.py @@ -597,7 +597,10 @@ class ControlParser (object): chunks = self._replace_control_codes(text) chunks = self._decode_text(chunks) for chunk in chunks: - _LOG.debug(chunk) + if isinstance(chunk, str): + _LOG.debug(repr(chunk)) + else: + _LOG.debug(chunk) chunks = self._replace_tabs(chunks) chunks = self._merge_adjacent_text(chunks) chunks = self._remove_operating_system_commands(chunks) -- 2.26.2