diff --git a/tests/RobotFramework/libraries/ThinEdgeIO/ThinEdgeIO.py b/tests/RobotFramework/libraries/ThinEdgeIO/ThinEdgeIO.py index 157e0d955e0..b56f51ca804 100644 --- a/tests/RobotFramework/libraries/ThinEdgeIO/ThinEdgeIO.py +++ b/tests/RobotFramework/libraries/ThinEdgeIO/ThinEdgeIO.py @@ -501,8 +501,7 @@ def _assert_mqtt_topic_messages( ) messages = [ - bytes.fromhex(item["payload_hex"]).decode("utf8") - # item["message"]["payload"] + bytes.fromhex(item["payload_hex"]).decode("utf8", errors="replace") for item in items ] @@ -525,7 +524,7 @@ def log_mqtt_messages(self, topic: str = "#", date_from: Union[datetime, float] **kwargs, ) entries = [ - f'{item["message"]["tst"].replace("+0000", ""):32} {item["message"]["topic"]:70} {bytes.fromhex(item["payload_hex"]).decode("utf8")}' + f'{item["message"]["tst"].replace("+0000", ""):32} {item["message"]["topic"]:70} {bytes.fromhex(item["payload_hex"]).decode("utf8", errors="replace")}' for item in items ] log.info("---- mqtt messages ----\n%s", "\n".join(entries))