Skip to content

Commit

Permalink
docs(storage): clarify docstring for 'Blob.download_as_string' (#9332)
Browse files Browse the repository at this point in the history
Specify that the returned value is bytes in the summary.

Closes #9290.
  • Loading branch information
tseaver authored Sep 27, 2019
1 parent cb5170b commit 20ebf60
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion storage/docs/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def storage_get_started(client, to_delete):
bucket = client.get_bucket("bucket-id-here")
# Then do other things...
blob = bucket.get_blob("/remote/path/to/file.txt")
assert blob.download_as_string() == "My old contents!"
assert blob.download_as_string() == b"My old contents!"
blob.upload_from_string("New contents!")
blob2 = bucket.blob("/remote/path/storage.txt")
blob2.upload_from_filename(filename="/local/path.txt")
Expand Down
2 changes: 1 addition & 1 deletion storage/google/cloud/storage/blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ def download_to_filename(self, filename, client=None, start=None, end=None):
os.utime(file_obj.name, (mtime, mtime))

def download_as_string(self, client=None, start=None, end=None):
"""Download the contents of this blob as a string.
"""Download the contents of this blob as a bytes object.
If :attr:`user_project` is set on the bucket, bills the API request
to that project.
Expand Down

0 comments on commit 20ebf60

Please sign in to comment.