Skip to content

Commit a29fea4

Browse files
humitosagjohnson
authored andcommitted
Sanitize command output when running under DockerBuildEnvironment (#4591)
In #4552 I fixed this for LocalBuildEnvironment but I forget to do exactly the same for Docker. This is what this commit does.
1 parent d245e59 commit a29fea4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

readthedocs/doc_builder/environments.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,8 @@ def run(self):
258258
stderr=True,
259259
)
260260

261-
output = client.exec_start(exec_id=exec_cmd['Id'], stream=False)
262-
try:
263-
self.output = output.decode('utf-8', 'replace')
264-
except (TypeError, AttributeError):
265-
self.output = ''
261+
cmd_output = client.exec_start(exec_id=exec_cmd['Id'], stream=False)
262+
self.output = self.sanitize_output(cmd_output)
266263
cmd_ret = client.exec_inspect(exec_id=exec_cmd['Id'])
267264
self.exit_code = cmd_ret['ExitCode']
268265

0 commit comments

Comments
 (0)