fedora messaging callback: don't open the temp file in binary mode

Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
This commit is contained in:
Aurélien Bompard 2023-05-23 09:51:18 +02:00
parent 9d89668ced
commit 8c4b49cdcb
No known key found for this signature in database
GPG key ID: 31584CFEB9BF64AD

View file

@ -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],