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.
pull/7002/head
Chun-wei Fan 5 years ago committed by Jussi Pakkanen
parent 415c9e14e7
commit 89bd55b9da
  1. 7
      mesonbuild/scripts/gtkdochelper.py

@ -74,7 +74,14 @@ def gtkdoc_run_check(cmd, cwd, library_paths=None):
err_msg.append(out) err_msg.append(out)
raise MesonException('\n'.join(err_msg)) raise MesonException('\n'.join(err_msg))
elif out: elif 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) print(out)
except UnicodeEncodeError:
pass
def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs, def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs,
main_file, module, module_version, main_file, module, module_version,

Loading…
Cancel
Save