ensure keys are converted to string as well

This commit is contained in:
Milan Kolar 2021-02-23 12:39:15 +01:00
parent ba2d1c7edd
commit 55df47c8f3
2 changed files with 4 additions and 16 deletions

View file

@ -94,7 +94,7 @@ def run_subprocess(*args, **kwargs):
# not passed.
env = kwargs.get("env") or os.environ
# Make sure environment contains only strings
filtered_env = {k: str(v) for k, v in env.items()}
filtered_env = {str(k): str(v) for k, v in env.items()}
# Use lib's logger if was not passed with kwargs.
logger = kwargs.pop("logger", log)

View file

@ -10,20 +10,8 @@ class RepairUnicodeStrings(pyblish.api.Collector):
order = pyblish.api.CollectorOrder
label = 'Unicode Strings'
actions = [pype.api.RepairContextAction]
def process(self, instance):
# invalid = self.get_invalid(instance)
# if invalid:
def process(self, context):
for key, value in os.environ.items():
self.log.info(type(value))
if type(value) is type(u't'):
os.environ[key] = str(value)
@classmethod
def get_invalid(cls, instance):
invalid = []
for key, value in os.environ.items():
if type(value) is type(u't'):
invalid.append((key, value))
return invalid
os.environ[str(key)] = str(value)