From: Tobias Brunner Date: Wed, 13 Jan 2021 13:41:50 +0000 (+0100) Subject: vici: Decode error messages in Python bindings X-Git-Tag: 5.9.2dr2~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2610cd792832b21391f9b39c05bdd8944966de27;p=thirdparty%2Fstrongswan.git vici: Decode error messages in Python bindings Otherwise we might end up with b'' in the output. --- diff --git a/src/libcharon/plugins/vici/python/vici/session.py b/src/libcharon/plugins/vici/python/vici/session.py index 0d6ee9b651..0a2a02f91b 100644 --- a/src/libcharon/plugins/vici/python/vici/session.py +++ b/src/libcharon/plugins/vici/python/vici/session.py @@ -78,7 +78,7 @@ class Session(CommandWrappers, object): if command_response["success"] != b"yes": raise CommandException( "Command failed: {errmsg}".format( - errmsg=command_response["errmsg"] + errmsg=command_response["errmsg"].decode("UTF-8") ) ) @@ -135,7 +135,7 @@ class Session(CommandWrappers, object): if command_response["success"] != b"yes": raise CommandException( "Command failed: {errmsg}".format( - errmsg=command_response["errmsg"] + errmsg=command_response["errmsg"].decode("UTF-8") ) )