From e102a0dc6d05d25681c00de6c20f937230efeb73 Mon Sep 17 00:00:00 2001 From: "Gael Chamoulaud (Strider)" Date: Mon, 23 Mar 2020 08:11:02 +0100 Subject: [PATCH] Don't write playbook stats in binary mode Don't write the json string in binary mode. Change-Id: Id151dc6ca801e032630a1c1b9c1570fba234ac9a Co-Authored-By: Rabi Mishra Signed-off-by: Gael Chamoulaud (Strider) --- validations_common/callback_plugins/validation_json.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validations_common/callback_plugins/validation_json.py b/validations_common/callback_plugins/validation_json.py index 274a931..186e6d8 100644 --- a/validations_common/callback_plugins/validation_json.py +++ b/validations_common/callback_plugins/validation_json.py @@ -152,7 +152,7 @@ class CallbackModule(CallbackBase): self.env['playbook_name'], self.current_time) - with open(log_file, 'wb') as js: + with open(log_file, 'w') as js: js.write(json.dumps(output, cls=AnsibleJSONEncoder, indent=4,