Skip to content
Commit 67a7b1e7 authored by Christopher Swinchatt's avatar Christopher Swinchatt Committed by Vincent Coubard
Browse files

io: Improve handling of invalid unicode codepoints



Applications running in FVPs/on boards may send garbage
data to serial. Python's bytes.decode/str.encode methods
default to strict encoding/decoding which raises exceptions
when bytes produce an invalid codepoint.

This commit changes:
* FvpController._spawn - to use 'replace' i.e. substitute the
unicode replacement character for any invalid codepoint
* TestDevice.communicate - to allow the caller to set the
error handling method, keeping 'strict' as the default

Signed-off-by: Christopher Swinchatt's avatarChris Swinchatt <christopher.swinchatt@arm.com>
parent db3e1ddc
Loading
Loading
Loading
Pipeline #4146 passed with stages
in 1 minute and 27 seconds