Skip to content

Commit 96092d4

Browse files
micahjsmithtseaver
andauthored
docs: use writeable streamin example for 'download_blob_to_file' (#676)
Co-authored-by: Tres Seaver <[email protected]>
1 parent 7d051b7 commit 96092d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

google/cloud/storage/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ def download_blob_to_file(
10651065
>>> bucket = client.get_bucket('my-bucket-name')
10661066
>>> blob = storage.Blob('path/to/blob', bucket)
10671067
1068-
>>> with open('file-to-download-to') as file_obj:
1068+
>>> with open('file-to-download-to', 'w') as file_obj:
10691069
>>> client.download_blob_to_file(blob, file_obj) # API request.
10701070
10711071
@@ -1074,7 +1074,7 @@ def download_blob_to_file(
10741074
>>> from google.cloud import storage
10751075
>>> client = storage.Client()
10761076
1077-
>>> with open('file-to-download-to') as file_obj:
1077+
>>> with open('file-to-download-to', 'w') as file_obj:
10781078
>>> client.download_blob_to_file(
10791079
>>> 'gs://bucket_name/path/to/blob', file_obj)
10801080

0 commit comments

Comments
 (0)