Azure / azure-storage-python

Microsoft Azure Storage Library for Python
https://azure-storage.readthedocs.io
MIT License
338 stars 240 forks source link

Fixed create_blob_from_stream with empty stream #608

Closed pjknkda closed 5 years ago

pjknkda commented 5 years ago

Fixed BlockBlobService.created_blob_from_stream failure when the input stream is empty by making _BlobChunkUploader.get_chunk_streams to yield empty bytes if the stream ends without any chunks.

pjknkda commented 5 years ago

I did test this MR with Azurite but found that this approach breaks other parts of the code in a real Azure Storage Account, so close this MR for further investigation. Also, I found that create_blob_from_stream with an empty stream only fails in Azurite emulator environment, not in a real Azure Storage Account.