diff --git a/fsspec/implementations/http.py b/fsspec/implementations/http.py index 7386d4b80..998d8ed1c 100644 --- a/fsspec/implementations/http.py +++ b/fsspec/implementations/http.py @@ -316,7 +316,7 @@ async def gen_chunks(): async with meth(self.encode_url(rpath), data=gen_chunks(), **kw) as resp: self._raise_not_found_for_status(resp, rpath) - async def _exists(self, path, **kwargs): + async def _exists(self, path, strict=False, **kwargs): kw = self.kwargs.copy() kw.update(kwargs) try: @@ -326,7 +326,10 @@ async def _exists(self, path, **kwargs): async with r: return r.status < 400 except aiohttp.ClientError: - return False + if strict: + raise + else: + return False async def _isfile(self, path, **kwargs): return await self._exists(path, **kwargs)