nicovank updated this revision to Diff 437163. nicovank added a comment. Looks like this causes the `misc-misleading-identifier` test to fail on the BuildKite Windows setup because it uses cp1252 and not utf-8. I think this is why the encode was added in the first place. This workaround should hopefully fix this, it will display unicode characters as '?' when stdout does not support utf-8.
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127807/new/ https://reviews.llvm.org/D127807 Files: clang-tools-extra/test/clang-tidy/check_clang_tidy.py Index: clang-tools-extra/test/clang-tidy/check_clang_tidy.py =================================================================== --- clang-tools-extra/test/clang-tidy/check_clang_tidy.py +++ clang-tools-extra/test/clang-tidy/check_clang_tidy.py @@ -173,13 +173,13 @@ print('Running ' + repr(args) + '...') clang_tidy_output = try_run(args) print('------------------------ clang-tidy output -----------------------') - print(clang_tidy_output.encode()) - print('\n------------------------------------------------------------------') + print(clang_tidy_output.encode(sys.stdout.encoding, errors="replace").decode(sys.stdout.encoding)) + print('------------------------------------------------------------------') diff_output = try_run(['diff', '-u', self.original_file_name, self.temp_file_name], False) - print('------------------------------ Fixes -----------------------------\n' + - diff_output + - '\n------------------------------------------------------------------') + print('------------------------------ Fixes -----------------------------') + print(diff_output) + print('------------------------------------------------------------------') return clang_tidy_output def check_fixes(self):
Index: clang-tools-extra/test/clang-tidy/check_clang_tidy.py =================================================================== --- clang-tools-extra/test/clang-tidy/check_clang_tidy.py +++ clang-tools-extra/test/clang-tidy/check_clang_tidy.py @@ -173,13 +173,13 @@ print('Running ' + repr(args) + '...') clang_tidy_output = try_run(args) print('------------------------ clang-tidy output -----------------------') - print(clang_tidy_output.encode()) - print('\n------------------------------------------------------------------') + print(clang_tidy_output.encode(sys.stdout.encoding, errors="replace").decode(sys.stdout.encoding)) + print('------------------------------------------------------------------') diff_output = try_run(['diff', '-u', self.original_file_name, self.temp_file_name], False) - print('------------------------------ Fixes -----------------------------\n' + - diff_output + - '\n------------------------------------------------------------------') + print('------------------------------ Fixes -----------------------------') + print(diff_output) + print('------------------------------------------------------------------') return clang_tidy_output def check_fixes(self):
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits