[PATCH] D74498: [clang-tidy] Fix performance-noexcept-move-constructor-fix.cpp on non-English locale

2020-02-13 Thread Alexandre Ganea via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG47abb43fc364: [clang-tidy] Fix 
performance-noexcept-move-constructor-fix test on non-English… (authored by 
aganea).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74498/new/

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
@@ -159,7 +159,7 @@
 diff_output = e.output
 
   print('-- Fixes -\n' 
+
-diff_output.decode() +
+diff_output.decode(errors='ignore') +
 '\n--')
 
   if has_check_fixes:


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
@@ -159,7 +159,7 @@
 diff_output = e.output
 
   print('-- Fixes -\n' +
-diff_output.decode() +
+diff_output.decode(errors='ignore') +
 '\n--')
 
   if has_check_fixes:
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D74498: [clang-tidy] Fix performance-noexcept-move-constructor-fix.cpp on non-English locale

2020-02-13 Thread Reid Kleckner via Phabricator via cfe-commits
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm, if the diff comes out wrong, that will not result in an incorrect 
pass/fail, but only less debugable output.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74498/new/

https://reviews.llvm.org/D74498



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D74498: [clang-tidy] Fix performance-noexcept-move-constructor-fix.cpp on non-English locale

2020-02-12 Thread Alexandre Ganea via Phabricator via cfe-commits
aganea updated this revision to Diff 244246.
aganea added a comment.

Better fix.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74498/new/

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
@@ -159,7 +159,7 @@
 diff_output = e.output
 
   print('-- Fixes -\n' 
+
-diff_output.decode() +
+diff_output.decode(errors='ignore') +
 '\n--')
 
   if has_check_fixes:


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
@@ -159,7 +159,7 @@
 diff_output = e.output
 
   print('-- Fixes -\n' +
-diff_output.decode() +
+diff_output.decode(errors='ignore') +
 '\n--')
 
   if has_check_fixes:
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D74498: [clang-tidy] Fix performance-noexcept-move-constructor-fix.cpp on non-English locale

2020-02-12 Thread Alexandre Ganea via Phabricator via cfe-commits
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 
  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