diff options
author | Christian Tismer <tismer@stackless.com> | 2021-04-10 16:00:10 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-04-11 11:43:24 +0000 |
commit | 8bf1ca923d707b48b6d5a1dffa7ad62893ae6204 (patch) | |
tree | bdd7ff2e823e91cb89bf107ab344aad4ca49ae44 | |
parent | 06cd70831129e35e4c4d732546c261522344a59b (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
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 2f88c10f824fb9aa6cb1dbfd18b2d071a48745f1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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 9e0a6b0d6..50c3970f4 100644 --- a/build_scripts/main.py +++ b/build_scripts/main.py @@ -883,6 +883,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: |