From dc87f8a7a45d6be5b09a2dd212e2af7cd141e324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Thu, 9 Sep 2021 22:01:04 +0200 Subject: [PATCH] events: unescape message to match the behavior of the C++ compiler --- Tools/px4events/srcparser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tools/px4events/srcparser.py b/Tools/px4events/srcparser.py index a4997032df..7a6c643cca 100644 --- a/Tools/px4events/srcparser.py +++ b/Tools/px4events/srcparser.py @@ -221,7 +221,8 @@ class SourceParser(object): else: raise Exception("Could not extract event ID from {:}".format(args_split[0])) event.name = event_name - event.message = args_split[2][1:-1] + # unescape \x, to treat the string the same as the C++ compiler + event.message = args_split[2][1:-1].encode("utf-8").decode('unicode_escape') elif call in ['reporter.healthFailure', 'reporter.armingCheckFailure']: assert len(args_split) == num_args + 5, \ "Unexpected Number of arguments for: {:}, {:}".format(args_split, num_args)