Skip to content

client.pull(stream=True) doesn't split stream lines correctly? #199

@joshuaconner

Description

@joshuaconner

This is on Ubuntu 13.10, with Docker 0.10.0:

Python 2.7.5+ (default, Sep 19 2013, 13:48:49)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import docker.client
>>> client = docker.Client()
>>> stream = client.pull('busybox', stream=True)
>>> chunks = [chunk for chunk in stream]
>>> len(chunks)
2
>>> chunks[0]
'{"status":"Pulling repository busybox"}'
>>> len(chunks[1])
22721

Basically chunks[0] is one line of the stream, and chunks[1] is every other line of the stream, concatenated. (I can take a look at making a PR for this tomorrow, if you'd like.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions