Skip to content

Commit 89bd55b

Browse files
fanc999-1jpakkane
authored andcommitted
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.
1 parent 415c9e1 commit 89bd55b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

mesonbuild/scripts/gtkdochelper.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,14 @@ def gtkdoc_run_check(cmd, cwd, library_paths=None):
7474
err_msg.append(out)
7575
raise MesonException('\n'.join(err_msg))
7676
elif out:
77-
print(out)
77+
# Unfortunately Windows cmd.exe consoles may be using a codepage
78+
# that might choke print() with a UnicodeEncodeError, so let's
79+
# ignore such errors for now, as a compromise as we are outputting
80+
# console output here...
81+
try:
82+
print(out)
83+
except UnicodeEncodeError:
84+
pass
7885

7986
def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs,
8087
main_file, module, module_version,

0 commit comments

Comments
 (0)