Skip to content

Commit

Permalink
Dropping internal usage of rewind in Blob.upload_from_string(). (#3365)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhermes authored May 4, 2017
1 parent d92306a commit 520637c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions storage/google/cloud/storage/blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,10 +919,9 @@ def upload_from_string(self, data, content_type='text/plain', client=None):
to the ``client`` stored on the blob's bucket.
"""
data = _to_bytes(data, encoding='utf-8')
string_buffer = BytesIO()
string_buffer.write(data)
string_buffer = BytesIO(data)
self.upload_from_file(
file_obj=string_buffer, rewind=True, size=len(data),
file_obj=string_buffer, size=len(data),
content_type=content_type, client=client)

def create_resumable_upload_session(
Expand Down

0 comments on commit 520637c

Please sign in to comment.