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(storage): clarify docstring for 'Blob.download_as_string' #9332

Merged
merged 3 commits into from
Sep 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

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