diff --git a/llvm/utils/lit/tests/Inputs/googletest-cmd-wrapper/DummySubDir/OneTest.exe b/llvm/utils/lit/tests/Inputs/googletest-cmd-wrapper/DummySubDir/OneTest.exe index 9b498b52ac9d10..7dcccb53570a45 100644 --- a/llvm/utils/lit/tests/Inputs/googletest-cmd-wrapper/DummySubDir/OneTest.exe +++ b/llvm/utils/lit/tests/Inputs/googletest-cmd-wrapper/DummySubDir/OneTest.exe @@ -42,7 +42,7 @@ dummy_output = """\ }""" json_filename = os.environ['GTEST_OUTPUT'].split(':', 1)[1] -with open(json_filename, 'w') as f: +with open(json_filename, 'w', encoding='utf-8') as f: if os.environ['GTEST_SHARD_INDEX'] == '0': f.write(output) else: diff --git a/llvm/utils/lit/tests/Inputs/googletest-crash/DummySubDir/OneTest.py b/llvm/utils/lit/tests/Inputs/googletest-crash/DummySubDir/OneTest.py index 1ff9f02e1c67ab..61530493caa510 100644 --- a/llvm/utils/lit/tests/Inputs/googletest-crash/DummySubDir/OneTest.py +++ b/llvm/utils/lit/tests/Inputs/googletest-crash/DummySubDir/OneTest.py @@ -44,7 +44,7 @@ exit_code = 1 else: json_filename = os.environ['GTEST_OUTPUT'].split(':', 1)[1] - with open(json_filename, 'w') as f: + with open(json_filename, 'w', encoding='utf-8') as f: f.write(dummy_output) exit_code = 0 diff --git a/llvm/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest.py b/llvm/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest.py index 32859c7e537563..120d7c0d67e2c7 100644 --- a/llvm/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest.py +++ b/llvm/utils/lit/tests/Inputs/googletest-format/DummySubDir/OneTest.py @@ -93,7 +93,7 @@ }""" json_filename = os.environ['GTEST_OUTPUT'].split(':', 1)[1] -with open(json_filename, 'w') as f: +with open(json_filename, 'w', encoding='utf-8') as f: if os.environ['GTEST_SHARD_INDEX'] == '0': print('[ RUN ] FirstTest.subTestB', flush=True) print('I am subTest B output', file=sys.stderr, flush=True) diff --git a/llvm/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest.py b/llvm/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest.py index d64d1dc14882e7..6a698938dc7224 100644 --- a/llvm/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest.py +++ b/llvm/utils/lit/tests/Inputs/googletest-timeout/DummySubDir/OneTest.py @@ -50,7 +50,7 @@ if os.environ['GTEST_SHARD_INDEX'] == '0': test_name = os.environ['GTEST_FILTER'] if test_name == 'QuickSubTest': - with open(json_filename, 'w') as f: + with open(json_filename, 'w', encoding='utf-8') as f: f.write(output) exit_code = 0 elif test_name == 'InfiniteLoopSubTest': @@ -61,7 +61,7 @@ else: raise SystemExit("error: invalid test name: %r" % (test_name,)) else: - with open(json_filename, 'w') as f: + with open(json_filename, 'w', encoding='utf-8') as f: f.write(dummy_output) exit_code = 0