[Openvpn-devel,XS] Change in openvpn[master]: gerrit-send-mail: Make output consistent across systems

Message ID 62782a197aefc6227cf97b1549a0807d39f96b42-HTML@gerrit.openvpn.net
State Superseded
Headers show
Series [Openvpn-devel,XS] Change in openvpn[master]: gerrit-send-mail: Make output consistent across systems | expand

Commit Message

flichtenheld (Code Review) Jan. 29, 2024, 10:45 a.m. UTC
Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/508?usp=email

to review the following change.


Change subject: gerrit-send-mail: Make output consistent across systems
......................................................................

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 <frank@lichtenheld.com>
---
M dev-tools/gerrit-send-mail.py
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/08/508/1

Patch

diff --git a/dev-tools/gerrit-send-mail.py b/dev-tools/gerrit-send-mail.py
index 5429aef..67a2cf1 100755
--- a/dev-tools/gerrit-send-mail.py
+++ b/dev-tools/gerrit-send-mail.py
@@ -109,7 +109,7 @@ 
     )
     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}")