[llvm] r374666 - [lit] Adjust error handling for decode introduced by r374665

Joel E. Denny via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 12 09:25:46 PDT 2019


Author: jdenny
Date: Sat Oct 12 09:25:46 2019
New Revision: 374666

URL: http://llvm.org/viewvc/llvm-project?rev=374666&view=rev
Log:
[lit] Adjust error handling for decode introduced by r374665

On that decode, Windows bots fail with:

```
UnicodeEncodeError: 'ascii' codec can't encode characters in position 7-8: ordinal not in range(128)
```

That's the same error as before r374665 except it's now at the decode
before the write to stdout.

Modified:
    llvm/trunk/utils/lit/lit/builtin_commands/diff.py

Modified: llvm/trunk/utils/lit/lit/builtin_commands/diff.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/lit/builtin_commands/diff.py?rev=374666&r1=374665&r2=374666&view=diff
==============================================================================
--- llvm/trunk/utils/lit/lit/builtin_commands/diff.py (original)
+++ llvm/trunk/utils/lit/lit/builtin_commands/diff.py Sat Oct 12 09:25:46 2019
@@ -97,7 +97,7 @@ def compareTwoTextFiles(flags, filepaths
                      n = flags.num_context_lines):
         if hasattr(diff, 'decode'):
             # python 2.7
-            diff = diff.decode()
+            diff = diff.decode(errors="backslashreplace")
         sys.stdout.write(diff)
         exitCode = 1
     return exitCode




More information about the llvm-commits mailing list