From 8c4b49cdcb6bc5466d6c447dfafcb3abd392bb39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Tue, 23 May 2023 09:51:18 +0200 Subject: [PATCH] fedora messaging callback: don't open the temp file in binary mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Aurélien Bompard --- callback_plugins/fedora_messaging_callback.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/callback_plugins/fedora_messaging_callback.py b/callback_plugins/fedora_messaging_callback.py index 29f4fe0c88..2211bf0082 100644 --- a/callback_plugins/fedora_messaging_callback.py +++ b/callback_plugins/fedora_messaging_callback.py @@ -53,7 +53,7 @@ def send_message(msg): msg["id"] = str(uuid.uuid4()) env = os.environ.copy() env["FEDORA_MESSAGING_CONF"] = FEDORA_MESSAGING_CONF - with NamedTemporaryFile() as msg_file: + with NamedTemporaryFile(mode="w+") as msg_file: json.dump(msg, msg_file) result = run( ["fedora-messaging", "publish", msg_file.name],