fsspec: `get_file` silently writes nothing for `file://` and Windows paths
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 58/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 842
- Fork
- 50
- Merge trung bình
- 9 giờ
- Pull request đã merge (30 ngày)
- 13
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của developmentseed/obstore
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
developmentseed/obstore#823 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
developmentseed/obstore#819 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
DNS lookups survive cancellationĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
developmentseed/obstore#816 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`put_async(Path)` opens files synchronously while holding the GILCó thể đã có người làm @kylebarron đã nhận 14 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
developmentseed/obstore#809 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 75/100
developmentseed/obstore#779 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của developmentseed/obstore
Issue tương tự
-
00 - Bug component: numpy.linalg
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
521xueweihan/HelloGitHub#4543 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
emeryberger/CSrankings#15700 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Bug | 工作不正常 Triage | 待检查
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
OneDragon-Anything/ZenlessZoneZero-OneDragon#3084 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Task select patterns with uppercase letters never matchCó thể đã có người làm @manobhisriram đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày