File tree 2 files changed +4
-6
lines changed
2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -194,7 +194,7 @@ def sanitize_output(self, output):
194
194
# https://code.djangoproject.com/ticket/28201
195
195
sanitized = sanitized .replace ('\x00 ' , '' )
196
196
except (TypeError , AttributeError ):
197
- sanitized = None
197
+ sanitized = ""
198
198
199
199
# Chunk the output data to be less than ``DATA_UPLOAD_MAX_MEMORY_SIZE``
200
200
output_length = len (output ) if output else 0
@@ -315,10 +315,8 @@ def run(self):
315
315
cmd_stdout , cmd_stderr = out
316
316
else :
317
317
cmd_stdout = out
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 "" )
318
+ self .output = self .sanitize_output (cmd_stdout )
319
+ self .error = self .sanitize_output (cmd_stderr )
322
320
cmd_ret = client .exec_inspect (exec_id = exec_cmd ['Id' ])
323
321
self .exit_code = cmd_ret ['ExitCode' ]
324
322
Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ def test_error_output(self):
255
255
cmd = BuildCommand (['/bin/bash' , '-c' , 'echo -n FOOBAR 1>&2' ])
256
256
cmd .run ()
257
257
self .assertEqual (cmd .output , 'FOOBAR' )
258
- self .assertIsNone (cmd .error )
258
+ self .assertEqual (cmd .error , "" )
259
259
260
260
def test_sanitize_output (self ):
261
261
cmd = BuildCommand (['/bin/bash' , '-c' , 'echo' ])
You can’t perform that action at this time.
0 commit comments