diff options
author | Ben Firshman <ben@firshman.co.uk> | 2014-01-28 13:32:24 +0000 |
---|---|---|
committer | Ben Firshman <ben@firshman.co.uk> | 2014-01-28 15:01:39 +0000 |
commit | b97e6ea0436c3ab59d2a912627e77636a2b65a6f (patch) | |
tree | a19eac7b3e8d85c2832fb1c060e0b30f9e121c74 | |
parent | 99ce1f7263e1fde9ea9fe6c9c9267e02451de3ae (diff) | |
download | docker-py-b97e6ea0436c3ab59d2a912627e77636a2b65a6f.tar.gz |
Fix _stream_result concatenating bytes with str
Without this option, requests returns lines as bytes on Python 3
which can't be concatenated with the str '\n' in the yield.
-rw-r--r-- | docker/client.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docker/client.py b/docker/client.py index 7347e31..c81aa9e 100644 --- a/docker/client.py +++ b/docker/client.py @@ -225,7 +225,7 @@ class Client(requests.Session): def _stream_result(self, response): """Generator for straight-out, non chunked-encoded HTTP responses.""" self._raise_for_status(response) - for line in response.iter_lines(chunk_size=1): + for line in response.iter_lines(chunk_size=1, decode_unicode=True): # filter out keep-alive new lines if line: yield line + '\n' |