Merge pull request #2655 from pypeclub/bugfix/OP-2591_Linux-app-launcher-does-not-handle-removed-environments

General: Linux app launcher script remove environments that are not passed
This commit is contained in:
Jakub Trllo 2022-02-07 13:11:13 +01:00 committed by GitHub
commit d9da306e6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View file

@ -18,6 +18,7 @@ def add_implementation_envs(env, _app):
new_hiero_paths.append(norm_path)
env["HIERO_PLUGIN_PATH"] = os.pathsep.join(new_hiero_paths)
env.pop("QT_AUTO_SCREEN_SCALE_FACTOR", None)
# Try to add QuickTime to PATH
quick_time_path = "C:/Program Files (x86)/QuickTime/QTSystem"

View file

@ -1040,10 +1040,19 @@ class ApplicationLaunchContext:
# Prepare data that will be passed to midprocess
# - store arguments to a json and pass path to json as last argument
# - pass environments to set
app_env = self.kwargs.pop("env", {})
json_data = {
"args": self.launch_args,
"env": self.kwargs.pop("env", {})
"env": app_env
}
if app_env:
# Filter environments of subprocess
self.kwargs["env"] = {
key: value
for key, value in os.environ.items()
if key in app_env
}
# Create temp file
json_temp = tempfile.NamedTemporaryFile(
mode="w", prefix="op_app_args", suffix=".json", delete=False