From 0524836bfc01dfb62dd6ed4f20396d9217e15ed2 Mon Sep 17 00:00:00 2001 From: Lars Holmberg Date: Fri, 8 Mar 2024 09:17:27 +0100 Subject: [PATCH] Explicitly set character encoding for locustfile downloaded from master. --- locust/argument_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locust/argument_parser.py b/locust/argument_parser.py index 6f93309239..09cac036b2 100644 --- a/locust/argument_parser.py +++ b/locust/argument_parser.py @@ -293,7 +293,7 @@ def wait_for_reply(): sys.exit(1) filename = msg.data["filename"] - with open(os.path.join(tempfile.gettempdir(), filename), "w") as locustfile: + with open(os.path.join(tempfile.gettempdir(), filename), "w", encoding="utf-8") as locustfile: locustfile.write(msg.data["contents"]) def exit_handler():