diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-12-07 22:04:07 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-12-07 23:12:44 +0200 |
commit | c6e022b560440fccbcfb75d529dc382b2ec017de (patch) | |
tree | 3bc3ab5d2f4d24e637120d30c3bf1a140944dea9 | |
parent | ca2e378c988f92a339e51ad8bd5a61da8d1cbe55 (diff) | |
download | meson-c6e022b560440fccbcfb75d529dc382b2ec017de.zip meson-c6e022b560440fccbcfb75d529dc382b2ec017de.tar.gz meson-c6e022b560440fccbcfb75d529dc382b2ec017de.tar.bz2 |
Print ASCII version of unrepresentable text. Closes #4600.
-rw-r--r-- | mesonbuild/mtest.py | 6 |
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: |