libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [libcloud] Kami commented on a change in pull request #1287: [LIBCLOUD-1043] Fix Azure upload_object_via_stream used with iter
Date Sun, 26 May 2019 18:03:36 GMT
Kami commented on a change in pull request #1287: [LIBCLOUD-1043] Fix Azure upload_object_via_stream
used with iter
URL: https://github.com/apache/libcloud/pull/1287#discussion_r287608461
 
 

 ##########
 File path: libcloud/storage/drivers/azure_blobs.py
 ##########
 @@ -825,7 +826,12 @@ def upload_object_via_stream(self, iterator, container, object_name,
         """
         self._check_values(ex_blob_type, ex_page_blob_size)
         if ex_blob_type == "BlockBlob":
-            iterator.seek(0, os.SEEK_END)
+            try:
+                iterator.seek(0, os.SEEK_END)
+            except AttributeError:
+                buffer = BytesIO()
+                buffer.writelines(iterator)
 
 Review comment:
   How does this work - does it need to exhaust and buffer the whole iterator in memory (inside
buffer object) or does it read the iterator as it iterates over it and writes it as part of
a request?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message