Skip to content

Commit 30aa370

Browse files
stsewdericholscher
andauthored
Docker environment: check for None on stdout/stderr response (#9238)
Docker returns None if there wasn't anything printed to stdout/stderr. Co-authored-by: Eric Holscher <[email protected]>
1 parent abb5d37 commit 30aa370

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

readthedocs/doc_builder/environments.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,10 @@ def run(self):
315315
cmd_stdout, cmd_stderr = out
316316
else:
317317
cmd_stdout = out
318-
self.output = self.sanitize_output(cmd_stdout)
319-
self.error = self.sanitize_output(cmd_stderr)
318+
# Docker returns None when there's no stderr/stdout
319+
# so we need to convert that to a string.
320+
self.output = self.sanitize_output(cmd_stdout or "")
321+
self.error = self.sanitize_output(cmd_stderr or "")
320322
cmd_ret = client.exec_inspect(exec_id=exec_cmd['Id'])
321323
self.exit_code = cmd_ret['ExitCode']
322324

0 commit comments

Comments
 (0)