Skip to content

ftpfs possible issue with openbin #406

@al8ba

Description

@al8ba

Recently, while trying out the ftpfs, I've noticed that to open a binary file-like object for writing by some third-party packages I have to do this:

with open_fs("ftp://anonymous:anonymous@localhost:8021") as fs:
    with fs.openbin("test.bin", "wb") as f:
        ...

Note in the above the mode param used in openbin includes b: Looking at the docs for the mode param it suggests the b is implied via openbin, but b isn't implicitly added to the mode of the file-like that is returned by openbin - this means that, unless b is explicitly provided as above, third-party packages that inspect the mode of the file-like may complain that it is not opened in binary mode.

Should openbin not reflect the implied b by implicitly adding b to the mode?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions