8000 Use protocol for GzipFile fileobj parameter · Issue #5099 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content
Use protocol for GzipFile fileobj parameter #5099
Closed
@jlost

Description

@jlost
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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0