From 852d79b08d708ff25c1f8bee3b68ffb11ea98dc0 Mon Sep 17 00:00:00 2001 From: Joffrey F Date: Thu, 8 Nov 2018 17:32:33 -0800 Subject: [PATCH] Fix file mode in image.save examples Signed-off-by: Joffrey F --- docker/api/image.py | 2 +- 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 1c1fcde8..a9f801e9 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 28b1fd3f..4578c0bd 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()