From: Michael Goldish Subject: [KVM-AUTOTEST PATCH 17/18] KVM test: kvm_subprocess.py: don't sanitize text before passing it to callbacks Date: Fri, 18 Jun 2010 03:14:34 +0300 Message-ID: <1276820075-31310-17-git-send-email-mgoldish@redhat.com> References: <1276820075-31310-1-git-send-email-mgoldish@redhat.com> <1276820075-31310-2-git-send-email-mgoldish@redhat.com> <1276820075-31310-3-git-send-email-mgoldish@redhat.com> <1276820075-31310-4-git-send-email-mgoldish@redhat.com> <1276820075-31310-5-git-send-email-mgoldish@redhat.com> <1276820075-31310-6-git-send-email-mgoldish@redhat.com> <1276820075-31310-7-git-send-email-mgoldish@redhat.com> <1276820075-31310-8-git-send-email-mgoldish@redhat.com> <1276820075-31310-9-git-send-email-mgoldish@redhat.com> <1276820075-31310-10-git-send-email-mgoldish@redhat.com> <1276820075-31310-11-git-send-email-mgoldish@redhat.com> <1276820075-31310-12-git-send-email-mgoldish@redhat.com> <1276820075-31310-13-git-send-email-mgoldish@redhat.com> <1276820075-31310-14-git-send-email-mgoldish@redhat.com> <1276820075-31310-15-git-send-email-mgoldish@redhat.com> <1276820075-31310-16-git-send-email-mgoldish@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: autotest@test.kernel.org, kvm@vger.kernel.org Return-path: In-Reply-To: <1276820075-31310-16-git-send-email-mgoldish@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: autotest-bounces@test.kernel.org Errors-To: autotest-bounces@test.kernel.org List-Id: kvm.vger.kernel.org Converting the text to utf-8 seems to cause trouble when converting back (e.g. when writing to files). The logging system seems to be fine with unsanitized text, so let's not sanitize it. Signed-off-by: Michael Goldish --- client/tests/kvm/kvm_subprocess.py | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/client/tests/kvm/kvm_subprocess.py b/client/tests/kvm/kvm_subprocess.py index 73edc5d..93a8429 100755 --- a/client/tests/kvm/kvm_subprocess.py +++ b/client/tests/kvm/kvm_subprocess.py @@ -688,9 +688,7 @@ class kvm_tail(kvm_spawn): def print_line(text): # Pre-pend prefix and remove trailing whitespace text = self.output_prefix + text.rstrip() - # Sanitize text - text = text.decode("utf-8", "replace") - # Pass it to output_func + # Pass text to output_func try: params = self.output_params + (text,) self.output_func(*params) @@ -888,7 +886,7 @@ class kvm_expect(kvm_tail): if str.endswith("\n"): str = str[:-1] for line in str.split("\n"): - print_func(line.decode("utf-8", "replace")) + print_func(line) data += newdata done = False -- 1.5.4.1