From 97b2b538eb5753acf46c10cc00e924b909f7a254 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Wed, 4 Sep 2024 14:01:11 +0200 Subject: [PATCH] [nrf fromtree] scripts: pylib: twister: fix missing newlines at handler.log Keep new lines at handler.log. (cherry picked from commit f0bfaa4c1903a51647a76a6565994377e9ba8d10) Signed-off-by: Piotr Kosycarz --- 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 e14c86719a7..5dd4340bc5e 100755 --- a/scripts/pylib/twister/twisterlib/handlers.py +++ b/scripts/pylib/twister/twisterlib/handlers.py @@ -422,7 +422,7 @@ def monitor_serial(self, ser, halt_event, harness): # is available yet. if serial_line: # can be more lines in serial_line so split them before handling - for sl in serial_line.decode('utf-8', 'ignore').splitlines(): + for sl in serial_line.decode('utf-8', 'ignore').splitlines(keepends=True): log_out_fp.write(strip_ansi_sequences(sl).encode('utf-8')) log_out_fp.flush() if sl := sl.strip():