diff options
author | Christian Tismer <tismer@stackless.com> | 2021-04-10 16:00:10 +0200 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2021-04-11 11:59:53 +0200 |
commit | 2f88c10f824fb9aa6cb1dbfd18b2d071a48745f1 (patch) | |
tree | d8d524b38e86688ca27c572de7e40fb5248d94e5 /build_scripts | |
parent | 67c1f6f0bb76fbbdf0e866f8f61d3afe079e741d (diff) |
Enable shiboken documentation build for macOS again
Python v3.6 and docutils v0.17 have an encoding problem,
because the default encoding is ASCII.
That produces an encoding error on macOS in Sphinx:
Running Sphinx v3.5.3
Encoding error:
'ascii' codec can't decode byte 0xc2 in position 69: ordinal not in range(128)
The problem happens on macOS because CI uses that old version.
It can be avoided by setting UTF-8 encoding.
Change-Id: I88ee27cfb529dfec291dc079bcc2d52f656f180f
Pick-to: 5.15
Pick-to: 6.0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'build_scripts')
-rw-r--r-- | build_scripts/main.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/build_scripts/main.py b/build_scripts/main.py index b6d275f32..a059ea834 100644 --- a/build_scripts/main.py +++ b/build_scripts/main.py @@ -888,6 +888,13 @@ class PysideBuild(_build, DistUtilsCommandMixin): if run_process(cmd_make) != 0: raise DistutilsSetupError(f"Error compiling {extension}") + if sys.version_info == (3, 6) and sys.platform == "darwin": + # Python 3.6 has a Sphinx problem because of docutils 0.17 . + # Instead of pinning v0.16, setting the default encoding fixes that. + # Since other platforms are not affected, we restrict this to macOS. + if "UTF-8" not in os.environ.get("LC_ALL", ""): + os.environ["LC_ALL"] = "en_US.UTF-8" + if not OPTION["SKIP_DOCS"]: if extension.lower() == SHIBOKEN: try: |