#27854: Make `collectstatic` warn (rather than blow up) on missing directories
-------------------------------------+-------------------------------------
Reporter: David Evans | Owner: nobody
Type: Uncategorized | Status: new
Component: contrib.staticfiles | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by David Evans):
Replying to [comment:1 Tim Graham]:
> Maybe the current error message could be improved. What does it say?
>
> Did you research the origin of the current exception to see if you can
find any design decisions there?
The exception is just `OSError: [Errno 2] No such file or directory`
This bubbles up from directly from the call to `os.listdir` here:
https://github.com/django/django/blob/1f7ca858664491589ba400419a491dd0a9af5dff/django/core/files/storage.py#L312
So I don't think there was any deliberate design decision here.
Also, I don't think improving the error message will solve this specific
problem because:
a. If the user is deploying to Heroku then they are just told that the
collectstatic step was skipped due to errors, but they have to run the
command themselves to see what those errors were.
b. An error message about missing directories is confusing to them because
they can see the directory right there on their filesystem. The fact that
git doesn't track empty directories is then yet another bit of weird
computer arcanery that we need to expose them to when they are just trying
to deploy "My First Website".
--
Ticket URL: <https://code.djangoproject.com/ticket/27854#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.6f1752076a1b6680ca4c7fce4fcf16c6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.