@@ -951,9 +951,7 @@ def get_handle(
951
951
)
952
952
953
953
954
- # error: Definition of "__enter__" in base class "IOBase" is incompatible
955
- # with definition in base class "BinaryIO"
956
- class _BufferedWriter (BytesIO , ABC ): # type: ignore[misc]
954
+ class _BufferedWriter (BytesIO , ABC ):
957
955
"""
958
956
Some objects do not support multiple .write() calls (TarFile and ZipFile).
959
957
This wrapper writes to the underlying buffer on close.
@@ -990,9 +988,10 @@ def __init__(
990
988
super ().__init__ ()
991
989
self .archive_name = archive_name
992
990
self .name = name
993
- # error: Incompatible types in assignment (expression has type "TarFile",
994
- # base class "_BufferedWriter" defined the type as "BytesIO")
995
- self .buffer : tarfile .TarFile = tarfile .TarFile .open ( # type: ignore[assignment]
991
+ # error: No overload variant of "open" of "TarFile" matches argument
992
+ # types "str | None", "str", "ReadBuffer[bytes] | WriteBuffer[bytes] | None",
993
+ # "dict[str, Any]"
994
+ self .buffer : tarfile .TarFile = tarfile .TarFile .open ( # type: ignore[call-overload]
996
995
name = name ,
997
996
mode = self .extend_mode (mode ),
998
997
fileobj = fileobj ,
@@ -1045,9 +1044,10 @@ def __init__(
1045
1044
self .archive_name = archive_name
1046
1045
1047
1046
kwargs .setdefault ("compression" , zipfile .ZIP_DEFLATED )
1048
- # error: Incompatible types in assignment (expression has type "ZipFile",
1049
- # base class "_BufferedWriter" defined the type as "BytesIO")
1050
- self .buffer : zipfile .ZipFile = zipfile .ZipFile ( # type: ignore[assignment]
1047
+ # error: No overload variant of "ZipFile" matches argument types
1048
+ # "str | PathLike[str] | ReadBuffer[bytes] | WriteBuffer[bytes]",
1049
+ # "str", "dict[str, Any]"
1050
+ self .buffer : zipfile .ZipFile = zipfile .ZipFile ( # type: ignore[call-overload]
1051
1051
file , mode , ** kwargs
1052
1052
)
1053
1053
0 commit comments