Sanitize command output when running under DockerBuildEnvironment
In I fixed this for LocalBuildEnvironment but I forget to do
exactly the same for Docker. This is what this commit does.
@@ -258,11 +258,8 @@ class DockerBuildCommand(BuildCommand):
stderr=True,
)
- output = client.exec_start(exec_id=exec_cmd['Id'], stream=False)
- try:
- self.output = output.decode('utf-8', 'replace')
- except (TypeError, AttributeError):
- self.output = ''
+ cmd_output = client.exec_start(exec_id=exec_cmd['Id'], stream=False)
+ self.output = self.sanitize_output(cmd_output)
cmd_ret = client.exec_inspect(exec_id=exec_cmd['Id'])
self.exit_code = cmd_ret['ExitCode']
