]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
gerrit-send-mail: Make output consistent across systems
authorFrank Lichtenheld <frank@lichtenheld.com>
Mon, 29 Jan 2024 14:57:56 +0000 (15:57 +0100)
committerGert Doering <gert@greenie.muc.de>
Mon, 29 Jan 2024 15:03:42 +0000 (16:03 +0100)
When writing the file specify encoding and newline, so that
the local settings (like locale) do not change the output.

Change-Id: Id7b4bda38adfbb446bdac635ac5d5207ef3f2f40
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Message-Id: <20240129145756.769-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28153.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
dev-tools/gerrit-send-mail.py

index 5429aef6d9faef27e396a88c0637da9e063d4489..67a2cf1b1ebbb0db2fe48bb914e0f518dc64415e 100755 (executable)
@@ -109,7 +109,7 @@ Acked-by according to Gerrit (reflected above):
     )
     filename = f"gerrit-{args.changeid}-{details['revision']}.patch"
     patch_text_final = patch_text_mod.replace("Subject: [PATCH]", f"Subject: [PATCH v{details['revision']}]")
-    with open(filename, "w") as patch_file:
+    with open(filename, "w", encoding="utf-8", newline="\n") as patch_file:
         patch_file.write(patch_text_final)
     print("send with:")
     print(f"git send-email --in-reply-to {details['msg_id']} {filename}")