diff --git a/fig/cli/log_printer.py b/fig/cli/log_printer.py index f31fb9b874..dce47d2e0d 100644 --- a/fig/cli/log_printer.py +++ b/fig/cli/log_printer.py @@ -55,10 +55,15 @@ def read_websocket(websocket): break def split_buffer(reader, separator): + """ + Given a generator which yields strings and a separator string, + joins all input, splits on the separator and yields each chunk. + Requires that each input string is decodable as UTF-8. + """ buffered = '' for data in reader: - lines = (buffered + data).split(separator) + lines = (buffered + data.decode('utf-8')).split(separator) for line in lines[:-1]: yield line + separator if len(lines) > 1: