From f204ba17c31acf71ae54a364b93f62727462a11e Mon Sep 17 00:00:00 2001 From: Wynn Wilkes Date: Fri, 30 Apr 2021 14:06:27 -0600 Subject: [PATCH] Update to the environment_{file|loader} feature to fix compatibility with python 3.{4,5,6} --- supervisor/options.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/supervisor/options.py b/supervisor/options.py index e05266429..66ff3e1fa 100644 --- a/supervisor/options.py +++ b/supervisor/options.py @@ -1978,8 +1978,11 @@ def load_external_environment_definition_for_config(cls, config): try: from subprocess import check_output, CalledProcessError kwargs = dict(shell=True) - if not PY2: - kwargs['text'] = True + if sys.version_info.major >= 3: + if sys.version_info.minor >= 7: + kwargs['text'] = True + else: + kwargs['encoding'] = 'utf8' envdata = check_output(config.environment_loader, **kwargs)