forked from qt-creator/qt-creator
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 <david.schulz@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -89,7 +89,7 @@ def prepareFileExternal(fileName, content):
|
|||||||
test.log("Added trailing whitespace.")
|
test.log("Added trailing whitespace.")
|
||||||
modifiedContent += currentLine
|
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)
|
f.write(modifiedContent)
|
||||||
|
|
||||||
if not emptyLine or not trailingWS:
|
if not emptyLine or not trailingWS:
|
||||||
|
Reference in New Issue
Block a user