dotcloud/docker-py — pull request #210 by aanand (2014-04-23 16:44:46+00:00)
Title: Universally-compatible reading of chunked streams

Docker introduced newlines in stream output in version 0.9 (https://github.com/dotcloud/docker/pull/4276), but not to all endpoints - `POST /images/create`, for example, does not include them. This means that #184, though it fixed #176, introduced a regression in `client.pull('ubuntu', stream=True)`, as reported in #199.

This reverts to the old, less pleasant implementation of `_stream_helper()`, with a manual check for newlines to fix the original problem, without the accompanying regression. It should work against Docker 0.8, 0.9 and 0.10, both when building and when pulling.

Fixes #199.