Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions docker/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,16 @@ def _stream_helper(self, response, decode=False):
if decode:
if six.PY3:
data = data.decode('utf-8')
data = json.loads(data)
yield data
# remove the trailing newline
data = data.strip()
# split the data at any newlines
data_list = data.split("\r\n")
# load and yield each line seperately
for data in data_list:
data = json.loads(data)
yield data
else:
yield data
else:
# Response isn't chunked, meaning we probably
# encountered an error immediately
Expand Down