MCPcopy
hub / github.com/fastapi/fastapi / _lookup_path

Method _lookup_path

fastapi/routing.py:1923–1933  ·  view source on GitHub ↗
(self, path: str)

Source from the content-addressed store, hash-verified

1921 raise HTTPException(status_code=404)
1922
1923 async def _lookup_path(self, path: str) -> tuple[str, os.stat_result | None]:
1924 try:
1925 return await run_in_threadpool(self.lookup_path, path)
1926 except PermissionError:
1927 raise HTTPException(status_code=401) from None
1928 except OSError as exc:
1929 if exc.errno == errno.ENAMETOOLONG:
1930 raise HTTPException(status_code=404) from None
1931 raise exc
1932 except ValueError:
1933 raise HTTPException(status_code=404) from None
1934
1935 async def _lookup_static_resource(
1936 self, path: str

Callers 1

Calls 1

HTTPExceptionClass · 0.90

Tested by

no test coverage detected