fsspec / filesystem_spec

A specification that python filesystems should adhere to.
BSD 3-Clause "New" or "Revised" License
949 stars 343 forks source link

HTTPFileSystem breaks when range requests are not supported #1626

Open dholth opened 3 weeks ago

dholth commented 3 weeks ago
from fsspec.core import url_to_fs

ufs, url = url_to_fs("https://example.org/")
f = ufs.open("https://example.org/no-range-requests/data.txt")
f.seek(8192)
f.read(1)

Will raise # ValueError: The HTTP server doesn't appear to support range requests.

I was having trouble with cache options, but it turns out I was sending simplecache:: to the wrong place; this does work, but I don't really want to keep the seekable file around after the file is closed. Trying to be careful to open the file only once.

martindurant commented 3 weeks ago

Specifically:

dholth commented 3 weeks ago

IIUC, for my use case I could

martindurant commented 2 weeks ago

cf https://github.com/fsspec/filesystem_spec/discussions/1629