Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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