Skip to content

Commit

Permalink
Fix non-stream logs for python3
Browse files Browse the repository at this point in the history
  • Loading branch information
shin- committed Jun 20, 2014
1 parent 8a63e70 commit 3ad75e0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docker/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,16 @@ def logs(self, container, stdout=True, stderr=True, stream=False,
'follow': stream and 1 or 0}
url = self._url("/containers/{0}/logs".format(container))
res = self._get(url, params=params, stream=stream)
return stream and self._multiplexed_socket_stream_helper(res) or \
''.join([x for x in self._multiplexed_buffer_helper(res)])
if stream:
return self._multiplexed_socket_stream_helper(res)
elif six.PY3:
return bytes().join(
[x for x in self._multiplexed_buffer_helper(res)]
)
else:
return str().join(
[x for x in self._multiplexed_buffer_helper(res)]
)
return self.attach(
container,
stdout=stdout,
Expand Down

0 comments on commit 3ad75e0

Please sign in to comment.