Skip to content

Commit 6f39338

Browse files
Fix readinto typehint (#34444)
1 parent a7868e9 commit 6f39338

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

sdk/storage/azure-storage-blob/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ tokens to be used with multiple services. By default, the SAS token service scop
1313
Python 3.12.
1414
- Fixed an issue where authentication errors could raise `AttributeError` instead of `ClientAuthenticationError` when
1515
using async OAuth credentials.
16+
- Fixed an typing issue which incorrectly typed the `readinto` API. The correct input type is `IO[bytes]`.
1617

1718
## 12.19.0 (2023-11-07)
1819

sdk/storage/azure-storage-blob/azure/storage/blob/_download.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,10 +699,10 @@ def content_as_text(self, max_concurrency=1, encoding="UTF-8"):
699699
self._encoding = encoding
700700
return self.readall()
701701

702-
def readinto(self, stream: IO[T]) -> int:
702+
def readinto(self, stream: IO[bytes]) -> int:
703703
"""Download the contents of this file to a stream.
704704
705-
:param IO[T] stream:
705+
:param IO[bytes] stream:
706706
The stream to download to. This can be an open file-handle,
707707
or any writable stream. The stream must be seekable if the download
708708
uses more than one parallel connection.

sdk/storage/azure-storage-blob/azure/storage/blob/aio/_download_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,10 +605,10 @@ async def content_as_text(self, max_concurrency=1, encoding="UTF-8"):
605605
self._encoding = encoding
606606
return await self.readall()
607607

608-
async def readinto(self, stream: IO[T]) -> int:
608+
async def readinto(self, stream: IO[bytes]) -> int:
609609
"""Download the contents of this blob to a stream.
610610
611-
:param IO[T] stream:
611+
:param IO[bytes] stream:
612612
The stream to download to. This can be an open file-handle,
613613
or any writable stream. The stream must be seekable if the download
614614
uses more than one parallel connection.

0 commit comments

Comments
 (0)