Skip to content

FakeFileWrapper: How handle isinstance(ffw, io.BaseIO)? #705

Description

@buhtz

Out there in the world packages and functions exist that checking the type of an object to find out if iti s a file-like object or a path/pathname.

When I do pathlib.Path('foobar').open() in a PyFakeFS environment the result is a FakeFileWrapper.
It behaves like a file-like object it didn't pass type tests like this.

isinstance(file_object, io.BaseIO)

Now the question is how to handle that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions