]> granicus.if.org Git - llvm/commit
[lit] Try again to fix new tests that fail on Windows bots
authorJoel E. Denny <jdenny.ornl@gmail.com>
Sat, 12 Oct 2019 14:58:43 +0000 (14:58 +0000)
committerJoel E. Denny <jdenny.ornl@gmail.com>
Sat, 12 Oct 2019 14:58:43 +0000 (14:58 +0000)
commit383b3a14b606715a72e9f6d3e3b29a4974692c17
tree3bea884c2ae6758e2a55b171ee4b44bf153bbfaf
parentb47ea95d9b6e655acd74dad4d8d2e4f48b3a5385
[lit] Try again to fix new tests that fail on Windows bots

Based on the bot logs, when lit's internal diff runs on Windows, it
looks like binary diffs must be decoded also for Python 2.7.
Otherwise, writing the diff to stdout fails with:

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

I did not need to decode using Python 2.7.15 under Ubuntu.  When I do
it anyway in that case, `errors="backslashreplace"` fails for me:

```
TypeError: don't know how to handle UnicodeDecodeError in error callback
```

However, `errors="ignore"` works, so this patch uses that, hoping
it'll work on Windows as well.

This patch leaves `errors="backslashreplace"` for Python >= 3.5 as
there's no evidence yet that doesn't work and it produces more
informative binary diffs.  This patch also adjusts some lit tests to
succeed for either error handler.

This patch adjusts changes introduced by D68664.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374657 91177308-0d34-0410-b5e6-96231b3b80d8
utils/lit/lit/builtin_commands/diff.py
utils/lit/tests/shtest-shell.py