Skip to content

Reader raises after EOF #592

@nvictus

Description

@nvictus

Calling read with nonzero size on Python file-likes return an empty byte string once EOF is reached.

It seems obstore readers are inconsistent with this behavior and raise an exception instead.

f = open(..., "rb")
f.read()
f.read(1)  # -> b""

f = fsspec.open(..., mode="rb").open()
f.read()
f.read(1)  # -> b""

store = obstore.store.from_url(..., skip_signature=True)
f = obstore.open_reader(store, "")
f.read()
f.read(1)  # OSError: early eof

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions