From 6a6d05b941ac91cf9806e6d3f58ecdb15e0052dc Mon Sep 17 00:00:00 2001 From: Maureen Helm Date: Tue, 2 May 2023 17:00:30 -0500 Subject: [PATCH] twister: Remove newline suffix in BinaryHandler Simics converts newline characters when writing console output to stdout, so we need to remove them as a suffix string. Otherwise the console harness fails to match expected PASS/FAIL/RunID string patterns and twister tests timeout. Signed-off-by: Maureen Helm --- scripts/pylib/twister/twisterlib/handlers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pylib/twister/twisterlib/handlers.py b/scripts/pylib/twister/twisterlib/handlers.py index 57a7a297d9c..072fb4cd52f 100755 --- a/scripts/pylib/twister/twisterlib/handlers.py +++ b/scripts/pylib/twister/twisterlib/handlers.py @@ -203,7 +203,7 @@ class BinaryHandler(Handler): reader_t.join(this_timeout) if not reader_t.is_alive() and self.line != b"": line_decoded = self.line.decode('utf-8', "replace") - stripped_line = line_decoded.rstrip() + stripped_line = line_decoded.rstrip().removesuffix('\\r\\n') logger.debug("OUTPUT: %s", stripped_line) log_out_fp.write(line_decoded) log_out_fp.flush()