Open
Description
Versions:
- fsspec==2024.9.0
- s3fs==2024.9.0
- universal_pathlib==0.2.5
This code in core.py is causing problems:
if "buffering" in fsspec_kwargs:
fsspec_kwargs.setdefault("block_size", fsspec_kwargs.pop("buffering"))
Translation from buffering
-> block_size
results in read failures for files opened with buffering=-1
(the default for opening files) when passed to functions like json.load
for files on S3.
S3FileSystem.open does not specify what happens if a negative number of passed and I'll file a bug there too.
I don't have a public bucket to post a sample file, but I'll try to find one so that we can reproduce this behavior.
However, the obvious fix is something like this:
if "buffering" in fsspec_kwargs:
buffering = fsspec_kwargs.pop("buffering")
if buffering > 0:
fsspec_kwargs.setdefault("block_size", buffering)