From 6567e7d934dacc1d266779384dd50d7135270b28 Mon Sep 17 00:00:00 2001 From: Connor Fawcett Date: Wed, 2 Oct 2024 14:27:17 +0100 Subject: [PATCH] qa/vstart-runner: Only remove non-ASCII characters from string-based command outputs Signed-off-by: Connor Fawcett Fixes: https://tracker.ceph.com/issues/68368 --- qa/tasks/vstart_runner.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index ca929ba05b44e..2ed2143133064 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -233,6 +233,11 @@ class LocalRemoteProcess(object): else: self.stderr.write(err) + def _handle_subprocess_output(self, output, stream): + if isinstance(stream, StringIO): + return rm_nonascii_chars(output) + return output + def wait(self, timeout=None): # Null subproc.stdin so communicate() does not try flushing/closing it # again. @@ -250,7 +255,8 @@ class LocalRemoteProcess(object): return out, err = self.subproc.communicate(timeout=timeout) - out, err = rm_nonascii_chars(out), rm_nonascii_chars(err) + out = self._handle_subprocess_output(out, self.stdout) + err = self._handle_subprocess_output(err, self.stderr) self._write_stdout(out) self._write_stderr(err) -- 2.39.5