From 383cfb77cc16cfb679f08930ba26cd95c0a84c42 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 19 Sep 2023 10:26:28 +0200 Subject: [PATCH] SquishTests: Fix writing test files on Windows Writing the text test files without encoding can end up in ANSI encoding of the files and in turn a fail when opening as the file is treated read only until correct encoding is used. Change-Id: I9e21e240b3b02011a2266dfda1f1b453c3dad457 Reviewed-by: David Schulz Reviewed-by: Christian Stenger --- tests/system/suite_editors/tst_clean_whitespaces/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system/suite_editors/tst_clean_whitespaces/test.py b/tests/system/suite_editors/tst_clean_whitespaces/test.py index 5c9e7aa6a65..7803027f869 100644 --- a/tests/system/suite_editors/tst_clean_whitespaces/test.py +++ b/tests/system/suite_editors/tst_clean_whitespaces/test.py @@ -89,7 +89,7 @@ def prepareFileExternal(fileName, content): test.log("Added trailing whitespace.") modifiedContent += currentLine - with open(fileName, "w") as f: + with open(fileName, "w", encoding="utf-8") as f: # used only with text files, so okay f.write(modifiedContent) if not emptyLine or not trailingWS: