You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sftp_client = paramiko.SFTPClient.from_transport(...)
out_gz = sftp_client.file(filename)
out = gzip.GzipFile(fileobj=out_gz, filename=filename)
^
Argument of type "SFTPFile" cannot be assigned to parameter "fileobj" of type "IO[bytes] | None" in function "__init__"
Type "SFTPFile" cannot be assigned to type "IO[bytes] | None"
"SFTPFile" is incompatible with "IO[bytes]"
Cannot assign to "None"
It seems like it should be compatible. Should I cast here? Any thoughts?
The text was updated successfully, but these errors were encountered:
GzipFile is still using IO as argument type, which is discouraged. We prefer custom protocols for argument types, and that would hopefully fix the problem above. Using cast() or # type: ignore is probably the best "quick" solution, until we land a proper fix in typeshed.
It seems like it should be compatible. Should I cast here? Any thoughts?
The text was updated successfully, but these errors were encountered: