diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-04-22 22:41:57 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-04-23 00:02:17 +0300 |
commit | c7e2549e59f690e35895a0a0fcd7ca3e6edaae31 (patch) | |
tree | 4f50a2d1f289957570705568ab0724e642570ce9 | |
parent | 166ed4009759e17c04c23fb01a99119defe7847d (diff) | |
download | meson-c7e2549e59f690e35895a0a0fcd7ca3e6edaae31.zip meson-c7e2549e59f690e35895a0a0fcd7ca3e6edaae31.tar.gz meson-c7e2549e59f690e35895a0a0fcd7ca3e6edaae31.tar.bz2 |
If printing debug printing fails, try again in pure ASCII.
-rwxr-xr-x | run_project_tests.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index d471460..8b7883b 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -204,8 +204,16 @@ def log_text_file(logfile, testdir, stdo, stde): logfile.write(stde) logfile.write('\n\n---\n\n') if print_debug: - print(stdo) - print(stde, file=sys.stderr) + try: + print(stdo) + except UnicodeError: + sanitized_out = stdo.encode('ascii', errors='replace').decode() + print(sanitized_out) + try: + print(stde, file=sys.stderr) + except UnicodeError: + sanitized_err = stde.encode('ascii', errors='replace').decode() + print(sanitized_err, file=sys.stderr) if stop: print("Aborting..") for f in futures: |