diff --git a/ansible_mitogen/runner.py b/ansible_mitogen/runner.py index 46539041..9089025d 100644 --- a/ansible_mitogen/runner.py +++ b/ansible_mitogen/runner.py @@ -454,6 +454,8 @@ class TemporaryEnvironment(object): self.original = dict(os.environ) self.env = env or {} for key, value in iteritems(self.env): + key = mitogen.core.to_text(key) + value = mitogen.core.to_text(value) if value is None: os.environ.pop(key, None) else: