Skip to content

Commit e6889eb

Browse files
committed
Fix file mode in image.save examples
Signed-off-by: Joffrey F <[email protected]>
1 parent 584204b commit e6889eb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docker/api/image.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def get_image(self, image, chunk_size=DEFAULT_DATA_CHUNK_SIZE):
3232
Example:
3333
3434
>>> image = cli.get_image("busybox:latest")
35-
>>> f = open('/tmp/busybox-latest.tar', 'w')
35+
>>> f = open('/tmp/busybox-latest.tar', 'wb')
3636
>>> for chunk in image:
3737
>>> f.write(chunk)
3838
>>> f.close()

docker/models/images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def save(self, chunk_size=DEFAULT_DATA_CHUNK_SIZE, named=False):
8484
Example:
8585
8686
>>> image = cli.get_image("busybox:latest")
87-
>>> f = open('/tmp/busybox-latest.tar', 'w')
87+
>>> f = open('/tmp/busybox-latest.tar', 'wb')
8888
>>> for chunk in image:
8989
>>> f.write(chunk)
9090
>>> f.close()

0 commit comments

Comments
 (0)