Skip to content

Commit 5365087

Browse files
committed
Build: solve problem with sanitized output
Reference #9238
1 parent e578554 commit 5365087

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

readthedocs/doc_builder/environments.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def sanitize_output(self, output):
194194
# https://code.djangoproject.com/ticket/28201
195195
sanitized = sanitized.replace('\x00', '')
196196
except (TypeError, AttributeError):
197-
sanitized = None
197+
sanitized = ""
198198

199199
# Chunk the output data to be less than ``DATA_UPLOAD_MAX_MEMORY_SIZE``
200200
output_length = len(output) if output else 0
@@ -317,8 +317,8 @@ def run(self):
317317
cmd_stdout = out
318318
# Docker returns None when there's no stderr/stdout
319319
# 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 "")
320+
self.output = self.sanitize_output(cmd_stdout)
321+
self.error = self.sanitize_output(cmd_stderr)
322322
cmd_ret = client.exec_inspect(exec_id=exec_cmd['Id'])
323323
self.exit_code = cmd_ret['ExitCode']
324324

0 commit comments

Comments
 (0)