diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_download.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_download.py index 6ba994735613..3557c50c9bf3 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_download.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_download.py @@ -656,7 +656,7 @@ def read(self, size: int = -1, *, chars: Optional[int] = None) -> T: output_stream: Union[BytesIO, StringIO] if self._text_mode: output_stream = StringIO() - size = chars if chars else sys.maxsize + size = sys.maxsize if chars is None or chars <= 0 else chars else: output_stream = BytesIO() size = size if size > 0 else sys.maxsize diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_download_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_download_async.py index dab5afdca85d..7f0821fb61d4 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_download_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_download_async.py @@ -558,7 +558,7 @@ async def read(self, size: int = -1, *, chars: Optional[int] = None) -> T: output_stream: Union[BytesIO, StringIO] if self._text_mode: output_stream = StringIO() - size = chars if chars else sys.maxsize + size = sys.maxsize if chars is None or chars <= 0 else chars else: output_stream = BytesIO() size = size if size > 0 else sys.maxsize