-
Notifications
You must be signed in to change notification settings - Fork 24
Open
@keen85
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", }, }
Metadata
Metadata
Assignees
Labels
No labels