From: W. Trevor King Date: Sun, 13 Jan 2013 15:23:08 +0000 (-0500) Subject: script-publish.py: Don't print raw strings to the log X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b137fa5fb39ab7ada15aaaaece081d683149ace5;p=mw2txt.git 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. --- 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)