encode / starlette

The little ASGI framework that shines. 🌟

Home Page:https://www.starlette.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

static: is a file not a directory

benjiqq opened this issue · comments

commented

in the case that the path is a file, not a dir, this error can be confusing https://github.com/encode/starlette/blob/master/starlette/staticfiles.py#L59C8-L59C81

Important

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
commented

if the path is a file it will say "Directory '{directory}' does not exist", which doesn't make sense. the path does exist its a file, not directory, so an error message like "Path is a file not a directory" would be clearer.