@@ -951,9 +951,7 @@ def get_handle(
951951 )
952952
953953
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 ):
957955 """
958956 Some objects do not support multiple .write() calls (TarFile and ZipFile).
959957 This wrapper writes to the underlying buffer on close.
@@ -990,9 +988,10 @@ def __init__(
990988 super ().__init__ ()
991989 self .archive_name = archive_name
992990 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]
996995 name = name ,
997996 mode = self .extend_mode (mode ),
998997 fileobj = fileobj ,
@@ -1045,9 +1044,10 @@ def __init__(
10451044 self .archive_name = archive_name
10461045
10471046 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]
10511051 file , mode , ** kwargs
10521052 )
10531053
0 commit comments