diff options
author | Chun-wei Fan <fanchunwei@src.gnome.org> | 2020-04-20 17:33:58 +0800 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-04-21 00:17:36 +0300 |
commit | 89bd55b9da6675d17bd4431aed99354603a7b312 (patch) | |
tree | 24387047907b3864e7e3b1c13a2430e42db1fa7f /mesonbuild/scripts/gtkdochelper.py | |
parent | 415c9e14e7079ca6db7a46a67ed947c5da914f60 (diff) | |
download | meson-89bd55b9da6675d17bd4431aed99354603a7b312.zip meson-89bd55b9da6675d17bd4431aed99354603a7b312.tar.gz meson-89bd55b9da6675d17bd4431aed99354603a7b312.tar.bz2 |
gtkdochelper.py: Ignore UnicodeEncodeError when printing output
Windows cmd.exe consoles may be using a code page that might choke
print() when we are outputting the output from calling gtk-doc. Let's
just ignore the error when it happens and print as much as we could in
this situation.
Diffstat (limited to 'mesonbuild/scripts/gtkdochelper.py')
-rw-r--r-- | mesonbuild/scripts/gtkdochelper.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mesonbuild/scripts/gtkdochelper.py b/mesonbuild/scripts/gtkdochelper.py index 36660ef..6b174a6 100644 --- a/mesonbuild/scripts/gtkdochelper.py +++ b/mesonbuild/scripts/gtkdochelper.py @@ -74,7 +74,14 @@ def gtkdoc_run_check(cmd, cwd, library_paths=None): err_msg.append(out) raise MesonException('\n'.join(err_msg)) elif out: - print(out) + # Unfortunately Windows cmd.exe consoles may be using a codepage + # that might choke print() with a UnicodeEncodeError, so let's + # ignore such errors for now, as a compromise as we are outputting + # console output here... + try: + print(out) + except UnicodeEncodeError: + pass def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs, main_file, module, module_version, |