diff options
author | Joffrey F <joffrey@docker.com> | 2016-10-12 17:19:08 -0700 |
---|---|---|
committer | Joffrey F <joffrey@docker.com> | 2016-10-12 17:52:43 -0700 |
commit | 059f61bf5a7b3252c1980342befe47ec6ea8f6bd (patch) | |
tree | 1e84a4389bf1b2d9428fca521de898fdb5e30570 /docker | |
parent | 008730c670afb2f88c7db308901586fb24f1a60c (diff) | |
download | docker-py-format_env_unicode_bug.tar.gz |
Do not break when calling format_environment with unicode valuesformat_env_unicode_bug
Signed-off-by: Joffrey F <joffrey@docker.com>
Diffstat (limited to 'docker')
-rw-r--r-- | docker/utils/utils.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/docker/utils/utils.py b/docker/utils/utils.py index b565732..10b9338 100644 --- a/docker/utils/utils.py +++ b/docker/utils/utils.py @@ -1001,6 +1001,9 @@ def format_environment(environment): def format_env(key, value): if value is None: return key + if isinstance(value, six.binary_type): + value = value.decode('utf-8') + return u'{key}={value}'.format(key=key, value=value) return [format_env(*var) for var in six.iteritems(environment)] |