aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2021-04-10 16:00:10 +0200
committerChristian Tismer <tismer@stackless.com>2021-04-12 16:57:27 +0200
commitf8d109aef3d54c9522c185b1dc427be45196d1fb (patch)
tree5b429839430dd69bd1a9148ca3f13280a186c055 /build_scripts
parentf9025b3f1999c1191a094c1dfdd3e0d215d47610 (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 CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'build_scripts')
-rw-r--r--build_scripts/main.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/build_scripts/main.py b/build_scripts/main.py
index 25f8ed2e6..86b9cbbbc 100644
--- a/build_scripts/main.py
+++ b/build_scripts/main.py
@@ -930,8 +930,14 @@ class PysideBuild(_build, DistUtilsCommandMixin):
if run_process(cmd_make) != 0:
raise DistutilsSetupError("Error compiling {}".format(extension))
- # macOS Python3 shows an encoding problem with sphinx
- if not OPTION["SKIP_DOCS"] and sys.platform != 'darwin':
+ 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() == "shiboken2":
try:
# Check if sphinx is installed to proceed.