Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: use writeable streamin example for 'download_blob_to_file' #676

Merged
merged 2 commits into from Dec 23, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions google/cloud/storage/client.py
Expand Up @@ -1065,7 +1065,7 @@ def download_blob_to_file(
>>> bucket = client.get_bucket('my-bucket-name')
>>> blob = storage.Blob('path/to/blob', bucket)

>>> with open('file-to-download-to') as file_obj:
>>> with open('file-to-download-to', 'w') as file_obj:
>>> client.download_blob_to_file(blob, file_obj) # API request.


Expand All @@ -1074,7 +1074,7 @@ def download_blob_to_file(
>>> from google.cloud import storage
>>> client = storage.Client()

>>> with open('file-to-download-to') as file_obj:
>>> with open('file-to-download-to', 'w') as file_obj:
>>> client.download_blob_to_file(
>>> 'gs://bucket_name/path/to/blob', file_obj)

Expand Down