aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-12-07 22:04:07 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2018-12-07 23:12:44 +0200
commitc6e022b560440fccbcfb75d529dc382b2ec017de (patch)
tree3bc3ab5d2f4d24e637120d30c3bf1a140944dea9
parentca2e378c988f92a339e51ad8bd5a61da8d1cbe55 (diff)
downloadmeson-c6e022b560440fccbcfb75d529dc382b2ec017de.zip
meson-c6e022b560440fccbcfb75d529dc382b2ec017de.tar.gz
meson-c6e022b560440fccbcfb75d529dc382b2ec017de.tar.bz2
Print ASCII version of unrepresentable text. Closes #4600.
-rw-r--r--mesonbuild/mtest.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py
index 1f9e7f8..8ce9538 100644
--- a/mesonbuild/mtest.py
+++ b/mesonbuild/mtest.py
@@ -539,7 +539,11 @@ Timeout: %4d
print('--- Listing only the last 100 lines from a long log. ---')
lines = lines[-100:]
for line in lines:
- print(line)
+ try:
+ print(line)
+ except UnicodeEncodeError:
+ line = line.encode('ascii', errors='replace').decode()
+ print(line)
def doit(self):
if self.is_run: