fsspec: `get_file` silently writes nothing for `file://` and Windows paths
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 58/100
Línea de trabajo
Start by reading FsspecStore._get_file and its path handling, then check the existing tests for get_file and get. Reproduce with a file:// destination and a Windows drive path; the issue also suggests using fsspec's split_protocol. Done means local paths are written, unsupported schemes raise ValueError, and tests cover both behaviors.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
FsspecStore.get_file returns without writing anything, and without raising, when the local path has a URL scheme. In _get_file:
res = urlparse(lpath)
if res.scheme or await self._local_store._isdir(lpath):
# lpath need to be local file and cannot contain scheme
return
So get_file("...", "file:///tmp/out.txt") looks like it worked but no file is created. Repro with obstore 0.12.1 and fsspec 2026.9.0, no credentials needed:
import os
from obstore.fsspec import FsspecStore
fs = FsspecStore("memory")
fs.pipe_file("src.txt", b"hello world")
fs.get_file("src.txt", "file:///tmp/out.txt")
print(os.path.exists("/tmp/out.txt")) # False, no error
fs.get_file("src.txt", "/tmp/out.txt")
print(os.path.exists("/tmp/out.txt")) # True
I think this also affects Windows: urlparse(r"C:\Users\me\out.txt").scheme is "c", so every get_file, and get (which calls _get_file), to a normal Windows path takes the same early return. I only have a Mac, so I checked the urlparse part but couldn't test it end to end. #763 might also get in the way on Windows after this point.
For a path with some other scheme, like s3://bucket/key, it also returns silently. Raising an error there seems better than doing nothing.
I have a small fix with tests: use fsspec's split_protocol (which doesn't treat a drive letter as a protocol), strip file://, and raise ValueError for other protocols. I will open a PR and link it here.
- Lenguaje dominante
- Python
- Estrellas
- 842
- Forks
- 50
- Merge medio
- 9 h
- PR fusionados (30 d)
- 13
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de developmentseed/obstore
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
developmentseed/obstore#823 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
developmentseed/obstore#819 ·
Los mantenedores suelen responder en 1 día
-
DNS lookups survive cancellationAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 18/100
developmentseed/obstore#816 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
`put_async(Path)` opens files synchronously while holding the GILPosiblemente ocupada @kylebarron la tomó hace 14 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
developmentseed/obstore#809 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 75/100
developmentseed/obstore#779 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de developmentseed/obstore
Issues similares
-
00 - Bug component: numpy.linalg
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
521xueweihan/HelloGitHub#4543 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
emeryberger/CSrankings#15700 ·
Los mantenedores suelen responder en 2 días
-
Bug | 工作不正常 Triage | 待检查
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
OneDragon-Anything/ZenlessZoneZero-OneDragon#3084 ·
Los mantenedores suelen responder en 1 día
-
Task select patterns with uppercase letters never matchPosiblemente ocupada @manobhisriram la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día