From f0bfaa4c1903a51647a76a6565994377e9ba8d10 Mon Sep 17 00:00:00 2001 From: Piotr Kosycarz Date: Wed, 4 Sep 2024 14:01:11 +0200 Subject: [PATCH] scripts: pylib: twister: fix missing newlines at handler.log Keep new lines at handler.log. 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 581569ee11b..4664c6dbadd 100755 --- a/scripts/pylib/twister/twisterlib/handlers.py +++ b/scripts/pylib/twister/twisterlib/handlers.py @@ -444,7 +444,7 @@ class DeviceHandler(Handler): # 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():