scripts: pylib: twister: fix missing newlines at handler.log

Keep new lines at handler.log.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
This commit is contained in:
Piotr Kosycarz 2024-09-04 14:01:11 +02:00 committed by Anas Nashif
commit f0bfaa4c19

View file

@ -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():