@@ -167,14 +167,14 @@ def from_url(
167167 # https://github.com/fsspec/filesystem_spec/issues/1722
168168 if "://" in path and not path .startswith ("http" ):
169169 # `not path.startswith("http")` is a special case for the http filesystem (¯\_(ツ)_/¯)
170- _ , path = path . split ( "://" , maxsplit = 1 )
170+ path = fs . _strip_protocol ( path )
171171
172172 return cls (fs = fs , path = path , mode = mode , allowed_exceptions = allowed_exceptions )
173173
174174 async def clear (self ) -> None :
175175 # docstring inherited
176176 try :
177- for subpath in await self .fs ._find (self .path , withdirs = True , refresh = True ):
177+ for subpath in await self .fs ._find (self .path , withdirs = True ):
178178 if subpath != self .path :
179179 await self .fs ._rm (subpath , recursive = True )
180180 except FileNotFoundError :
@@ -186,7 +186,7 @@ async def empty(self) -> bool:
186186 # TODO: it would be nice if we didn't have to list all keys here
187187 # it should be possible to stop after the first key is discovered
188188 try :
189- return not await self .fs ._ls (self .path , refresh = True )
189+ return not await self .fs ._ls (self .path )
190190 except FileNotFoundError :
191191 return True
192192
@@ -320,15 +320,15 @@ async def set_partial_values(
320320
321321 async def list (self ) -> AsyncGenerator [str , None ]:
322322 # docstring inherited
323- allfiles = await self .fs ._find (self .path , detail = False , withdirs = False , refresh = True )
323+ allfiles = await self .fs ._find (self .path , detail = False , withdirs = False )
324324 for onefile in (a .replace (self .path + "/" , "" ) for a in allfiles ):
325325 yield onefile
326326
327327 async def list_dir (self , prefix : str ) -> AsyncGenerator [str , None ]:
328328 # docstring inherited
329329 prefix = f"{ self .path } /{ prefix .rstrip ('/' )} "
330330 try :
331- allfiles = await self .fs ._ls (prefix , detail = False , refresh = True )
331+ allfiles = await self .fs ._ls (prefix , detail = False )
332332 except FileNotFoundError :
333333 return
334334 for onefile in (a .replace (prefix + "/" , "" ) for a in allfiles ):
@@ -337,7 +337,5 @@ async def list_dir(self, prefix: str) -> AsyncGenerator[str, None]:
337337 async def list_prefix (self , prefix : str ) -> AsyncGenerator [str , None ]:
338338 # docstring inherited
339339 find_str = f"{ self .path } /{ prefix } "
340- for onefile in await self .fs ._find (
341- find_str , detail = False , maxdepth = None , withdirs = False , refresh = True
342- ):
340+ for onefile in await self .fs ._find (find_str , detail = False , maxdepth = None , withdirs = False ):
343341 yield onefile .removeprefix (find_str )
0 commit comments