Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Auto fix unicode strings #1046

Merged
merged 2 commits into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pype/lib/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def _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)
Expand Down
15 changes: 15 additions & 0 deletions pype/plugins/global/publish/repair_unicode_strings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import os
import pyblish.api


class RepairUnicodeStrings(pyblish.api.Collector):
"""Validate all environment variables are string type.

"""

order = pyblish.api.CollectorOrder
label = 'Unicode Strings'

def process(self, context):
for key, value in os.environ.items():
os.environ[str(key)] = str(value)
40 changes: 0 additions & 40 deletions pype/plugins/maya/publish/validate_unicode_strings.py

This file was deleted.