diff options
| author | Joffrey F <joffrey@docker.com> | 2018-11-08 17:32:33 -0800 |
|---|---|---|
| committer | Joffrey F <joffrey@docker.com> | 2018-11-08 17:32:33 -0800 |
| commit | 852d79b08d708ff25c1f8bee3b68ffb11ea98dc0 (patch) | |
| tree | 875babb652dd6e2b602fd78c07d0addff55fcbf1 | |
| parent | cebdee4aefd6c17eeb3542f1c53f1c461b95ea61 (diff) | |
| download | docker-py-852d79b08d708ff25c1f8bee3b68ffb11ea98dc0.tar.gz | |
Fix file mode in image.save examples
Signed-off-by: Joffrey F <joffrey@docker.com>
| -rw-r--r-- | docker/api/image.py | 2 | ||||
| -rw-r--r-- | docker/models/images.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/docker/api/image.py b/docker/api/image.py index 1c1fcde..a9f801e 100644 --- a/docker/api/image.py +++ b/docker/api/image.py @@ -32,7 +32,7 @@ class ImageApiMixin(object): Example: >>> image = cli.get_image("busybox:latest") - >>> f = open('/tmp/busybox-latest.tar', 'w') + >>> f = open('/tmp/busybox-latest.tar', 'wb') >>> for chunk in image: >>> f.write(chunk) >>> f.close() diff --git a/docker/models/images.py b/docker/models/images.py index 28b1fd3..4578c0b 100644 --- a/docker/models/images.py +++ b/docker/models/images.py @@ -84,7 +84,7 @@ class Image(Model): Example: >>> image = cli.get_image("busybox:latest") - >>> f = open('/tmp/busybox-latest.tar', 'w') + >>> f = open('/tmp/busybox-latest.tar', 'wb') >>> for chunk in image: >>> f.write(chunk) >>> f.close() |
