From 0b31fe75262153a67f33b0af4506a15d4b6ccb03 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 22 Dec 2020 15:48:43 +0100 Subject: [PATCH] make sure it's totally independent --- pype/lib/applications.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pype/lib/applications.py b/pype/lib/applications.py index 94aed984fb..253ffa0ad2 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -531,12 +531,22 @@ class ApplicationLaunchContext: # Handle launch environemtns env = self.data.pop("env", None) + if env is not None and not isinstance(env, dict): + self.log.warning(( + "Passed `env` kwarg has invalid type: {}. Expected: `dict`." + " Using `os.environ` instead." + ).format(str(type(env)))) + env = None + if env is None: env = os.environ # subprocess.Popen keyword arguments self.kwargs = { - "env": env.copy() + "env": { + key: str(value) + for key, value in env.items() + } } if platform.system().lower() == "windows":