Skip to content

Commit

Permalink
docs: use writeable streamin example for 'download_blob_to_file' (#676)
Browse files Browse the repository at this point in the history
Co-authored-by: Tres Seaver <tseaver@palladion.com>
  • Loading branch information
micahjsmith and tseaver committed Dec 23, 2021
1 parent 7d051b7 commit 96092d4
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 96092d4

Please sign in to comment.