`LocalStore.head()` fails for existing local folders in Windows - making `FsspecStore.exists()`, `FsspecStore.rm()` fail too
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Domain
- backend, operating-systems
Research direction
Start at FsspecStore._info, the entry point shown in the traceback, and trace how LocalStore.head handles the Windows path C:/dev. Reproduce the existing-folder case on Windows, then verify that exists() and rm() work for local directories without regressing file and missing-path behavior.
Written by the indexing model from the issue text.
Description
Hi,
I noticed the following bug when working with local Windows URL-style paths:
✅ works fine
import fsspec
fs_fsspec = fsspec.filesystem("file")
fs_fsspec.exists("C:/dev/some.txt") # ✅ file does actually exist
fs_fsspec.exists("C:/dev/foo.txt") # ✅ file does not actually exist
fs_fsspec.exists("C:/dev/tmp") # ✅ folder does not actually exist
fs_fsspec.exists("C:/dev") # ✅ folder does actually exist
❌ fails
from obstore.fsspec import FsspecStore
fs_fsspecstore = FsspecStore("file")
fs_fsspecstore.exists("C:/dev/some.txt") # ✅ file does actually exist
fs_fsspecstore.exists("C:/dev/foo.txt") # ✅ file does not actually exist
fs_fsspecstore.exists("C:/dev/tmp") # ✅ folder does not actually exist
fs_fsspecstore.exists("C:/dev") # ❌ folder does actually exist
---------------------------------------------------------------------------
GenericError Traceback (most recent call last)
Cell In[28], line 5
3 fs_fsspecstore.exists("C:/dev/foo.txt") # file does not actually exist
4 fs_fsspecstore.exists("C:/dev/tmp") # folder does nor actually exist
----> 5 fs_fsspecstore.exists("C:/dev") # folder does actually exist
File c:\Users\...\.venv\lib\site-packages\fsspec\asyn.py:118, in sync_wrapper.<locals>.wrapper(*args, **kwargs)
115 @functools.wraps(func)
116 def wrapper(*args, **kwargs):
117 self = obj or args[0]
--> 118 return sync(self.loop, func, *args, **kwargs)
File c:\Users\...\.venv\lib\site-packages\fsspec\asyn.py:103, in sync(loop, func, timeout, *args, **kwargs)
101 raise FSTimeoutError from return_result
102 elif isinstance(return_result, BaseException):
--> 103 raise return_result
104 else:
105 return return_result
File c:\Users\...\.venv\lib\site-packages\fsspec\asyn.py:56, in _runner(event, coro, result, timeout)
54 coro = asyncio.wait_for(coro, timeout=timeout)
55 try:
---> 56 result[0] = await coro
57 except Exception as ex:
58 result[0] = ex
File c:\Users\...\.venv\lib\site-packages\fsspec\asyn.py:695, in AsyncFileSystem._exists(self, path, **kwargs)
693 async def _exists(self, path, **kwargs):
694 try:
--> 695 await self._info(path, **kwargs)
696 return True
697 except FileNotFoundError:
File c:\Users\...\.venv\lib\site-packages\obstore\fsspec.py:503, in FsspecStore._info(self, path, **_kwargs)
500 store = self._construct_store(bucket)
502 try:
--> 503 head = await obs.head_async(store, path_no_bucket)
504 return {
505 # Required of `info`: (?)
506 "name": head["path"],
(...)
512 "version": head["version"],
513 }
514 except FileNotFoundError:
GenericError: Generic LocalFileSystem error: Unable to open file C:\dev: Zugriff verweigert (os error 5)
Debug source:
Generic {
store: "LocalFileSystem",
source: UnableToOpenFile {
source: Os {
code: 5,
kind: PermissionDenied,
message: "Zugriff verweigert",
},
path: "C:\\dev",
},
}
- Dominant language
- Python
- Stars
- 842
- Forks
- 50
- Avg merge
- 9h
- Merged PRs (30d)
- 13
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from developmentseed/obstore
-
fsspec: `get_file` silently writes nothing for `file://` and Windows pathsPossibly taken @andyhetianjun claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 58/100
developmentseed/obstore#830 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
developmentseed/obstore#823 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
developmentseed/obstore#819 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 18/100
developmentseed/obstore#816 · 3 comments ·
Maintainers usually reply within 1 day
-
`put_async(Path)` opens files synchronously while holding the GILPossibly taken @kylebarron claimed this 14 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 48/100
developmentseed/obstore#809 · 1 comment ·
Maintainers usually reply within 1 day
All issues in developmentseed/obstore
Similar issues
-
00 - Bug component: numpy.linalg
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
521xueweihan/HelloGitHub#4543 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
emeryberger/CSrankings#15700 ·
Maintainers usually reply within 2 days
-
Bug | 工作不正常 Triage | 待检查
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
OneDragon-Anything/ZenlessZoneZero-OneDragon#3084 ·
Maintainers usually reply within 1 day
-
Task select patterns with uppercase letters never matchPossibly taken @manobhisriram claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day