aganea created this revision. aganea added reviewers: rnk, alexfh. Herald added subscribers: cfe-commits, xazax.hun. Herald added a project: clang.
When running on Windows under the following locale: D:\llvm-project>python Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.getlocale() ('French_Canada', '1252') >>> Fix the following issue: # command stderr: Traceback (most recent call last): File "D:/llvm-project/clang-tools-extra/test/../test\clang-tidy\check_clang_tidy.py", line 249, in <module> main() File "D:/llvm-project/clang-tools-extra/test/../test\clang-tidy\check_clang_tidy.py", line 245, in main run_test_once(args, extra_args) File "D:/llvm-project/clang-tools-extra/test/../test\clang-tidy\check_clang_tidy.py", line 162, in run_test_once diff_output.decode() + UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 2050: invalid continuation byte Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D74498 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 @@ -31,7 +31,7 @@ import re import subprocess import sys - +import locale def write_file(file_name, text): with open(file_name, 'w') as f: @@ -151,6 +151,13 @@ clang_tidy_output + '\n------------------------------------------------------------------') + try: + locale.setlocale('en_US') + except: + try: + locale.setlocale('en_US.uf8') + except: + try: diff_output = subprocess.check_output( ['diff', '-u', original_file_name, temp_file_name],
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 @@ -31,7 +31,7 @@ import re import subprocess import sys - +import locale def write_file(file_name, text): with open(file_name, 'w') as f: @@ -151,6 +151,13 @@ clang_tidy_output + '\n------------------------------------------------------------------') + try: + locale.setlocale('en_US') + except: + try: + locale.setlocale('en_US.uf8') + except: + try: diff_output = subprocess.check_output( ['diff', '-u', original_file_name, temp_file_name],
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits