Don't break when interpolating environment with unicode characters
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
7687412e03
commit
53fa44c01e
3 changed files with 28 additions and 0 deletions
|
|
@ -1109,6 +1109,8 @@ 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 '{key}={value}'.format(key=key, value=value)
|
||||
return [format_env(*item) for item in environment.items()]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue