fsspec: `get_file` silently writes nothing for `file://` and Windows paths
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 58/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 842
- フォーク
- 50
- 平均マージ
- 9時間
- マージ済み PR(30日)
- 13
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
developmentseed/obstore のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
developmentseed/obstore#823 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
developmentseed/obstore#819 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 18/100
developmentseed/obstore#816 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
`put_async(Path)` opens files synchronously while holding the GIL対応中かも @kylebarron が 14 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
developmentseed/obstore#809 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 75/100
developmentseed/obstore#779 · コメント 5 件 ·
メンテナーはふだん 1 日以内に返信
developmentseed/obstore の issue をすべて見る
似ている issue
-
00 - Bug component: numpy.linalg
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
521xueweihan/HelloGitHub#4543 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
emeryberger/CSrankings#15700 ·
メンテナーはふだん 2 日以内に返信
-
Bug | 工作不正常 Triage | 待检查
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
OneDragon-Anything/ZenlessZoneZero-OneDragon#3084 ·
メンテナーはふだん 1 日以内に返信
-
Task select patterns with uppercase letters never match対応中かも @manobhisriram が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信