From e1f8c599aeb840909f5ea8e9ae0bc4dab5bc7deb Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Mon, 29 Jan 2024 15:57:56 +0100 Subject: [PATCH] gerrit-send-mail: Make output consistent across systems 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 Acked-by: Arne Schwabe 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 --- dev-tools/gerrit-send-mail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-tools/gerrit-send-mail.py b/dev-tools/gerrit-send-mail.py index 5429aef6d9f..67a2cf1b1eb 100755 --- a/dev-tools/gerrit-send-mail.py +++ b/dev-tools/gerrit-send-mail.py @@ -109,7 +109,7 @@ def apply_patch_mods(patch_text, details, args): ) 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}")