From f8f528a42fa8106bb33acb29d11e37ea90c95d31 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 5 May 2021 15:48:47 +0200 Subject: [PATCH] don't use shell=True in extract burnin subprocess --- openpype/plugins/publish/extract_burnin.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/openpype/plugins/publish/extract_burnin.py b/openpype/plugins/publish/extract_burnin.py index 563d471323..49708da506 100644 --- a/openpype/plugins/publish/extract_burnin.py +++ b/openpype/plugins/publish/extract_burnin.py @@ -1,5 +1,6 @@ import os import re +import subprocess import json import copy import tempfile @@ -124,11 +125,6 @@ class ExtractBurnin(openpype.api.Extractor): # [pype executable, *pype script, "run"] executable_args = get_pype_execute_args("run", scriptpath) - # Environments for script process - env = os.environ.copy() - # pop PYTHONPATH - env.pop("PYTHONPATH", None) - for idx, repre in enumerate(tuple(instance.data["representations"])): self.log.debug("repre ({}): `{}`".format(idx + 1, repre["name"])) if not self.repres_is_valid(repre): @@ -251,10 +247,16 @@ class ExtractBurnin(openpype.api.Extractor): self.log.debug("Executing: {}".format(" ".join(args))) # Run burnin script - openpype.api.run_subprocess( - args, shell=True, logger=self.log, env=env - ) + process_kwargs = { + "logger": self.log, + "env": {} + } + if platform.system().lower() == "windows": + process_kwargs["creationflags"] = ( + subprocess.CREATE_NO_WINDOW + ) + openpype.api.run_subprocess(args, **process_kwargs) # Remove the temporary json os.remove(temporary_json_filepath)