summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-01-02 15:52:08 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-01-16 09:23:19 +0000
commit77de5fb2d02551eb7563ba1a42c74ad6581815fb (patch)
treea960cc0b506f2f0a2d9f0df0986d1be7690a5d6c
parentb7707a51337cd7982d298041fa3db2ed225bfc54 (diff)
setup.py: Fix running under non-UTF8 locale
Redirecting stderr to stdout causes an error when running under non-UTF8 locales. For the build scripts, it is also not desired to mix the output channels, so, remove the redirection. Change-Id: I6e3d05ede00537c3cc4c022780e8d0ed27bb0cad Fixes: PYSIDE-880 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--build_scripts/setup_runner.py2
-rw-r--r--build_scripts/utils.py5
-rw-r--r--coin_build_instructions.py15
3 files changed, 2 insertions, 20 deletions
diff --git a/build_scripts/setup_runner.py b/build_scripts/setup_runner.py
index 8efb2883..0e45a13f 100644
--- a/build_scripts/setup_runner.py
+++ b/build_scripts/setup_runner.py
@@ -148,7 +148,7 @@ class SetupRunner(object):
for cmd in self.invocations_list:
cmd_as_string = " ".join(cmd)
print("\nRunning process: {}\n".format(cmd_as_string))
- exit_code = run_process(cmd, redirect_stderr_to_stdout=False)
+ exit_code = run_process(cmd)
if exit_code != 0:
msg = textwrap.dedent("""
setup.py invocation failed with exit code: {}.\n\n
diff --git a/build_scripts/utils.py b/build_scripts/utils.py
index 924b698d..9500b340 100644
--- a/build_scripts/utils.py
+++ b/build_scripts/utils.py
@@ -399,10 +399,9 @@ def run_process_output(args, initial_env=None):
result.append(line.rstrip())
return result
-def run_process(args, initial_env=None, redirect_stderr_to_stdout=True):
+def run_process(args, initial_env=None):
"""
Run process until completion and return the process exit code.
- Prints both stdout and stderr to the console.
No output is captured.
"""
log.info("Running process in directory {0}: command {1}".format(
@@ -415,8 +414,6 @@ def run_process(args, initial_env=None, redirect_stderr_to_stdout=True):
kwargs = {}
kwargs['env'] = initial_env
- if redirect_stderr_to_stdout:
- kwargs['stderr'] = subprocess.STDOUT
exit_code = subprocess.call(args, **kwargs)
return exit_code
diff --git a/coin_build_instructions.py b/coin_build_instructions.py
index 969b9272..db021470 100644
--- a/coin_build_instructions.py
+++ b/coin_build_instructions.py
@@ -122,21 +122,6 @@ def call_setup(python_ver):
cmd += ["--package-timestamp=" + CI_INTEGRATION_ID]
env = os.environ
- if CI_HOST_OS == "MacOS":
- # On Python 3, setuptools.dist.handle_display_options does some
- # weird sys.stdout.detach-ing if the stdout encoding is
- # different from utf-8. This causes issues when running
- # subprocess.call() because that access the original stdout
- # object stored in sys.__stdout__ which was detached, and
- # results in an exception being thrown.
- # The Coin macOS locale by default is US-ASCII, and that
- # triggers the above issue. Set the encoding to UTF-8 which
- # makes sure to skip over the detach-ing code.
- # Relevant links to the issue:
- # https://bugs.python.org/issue15216
- # https://bitbucket.org/tarek/distribute/issues/334/fix-for-311-breaks-packages-that-use
- # https://github.com/pypa/virtualenv/issues/359
- env['LC_CTYPE'] = 'UTF-8'
run_instruction(cmd, "Failed to run setup.py", initial_env=env)
def run_build_instructions():