whitenoise
whitenoise copied to clipboard
FileNotFoundError during scantree() caused by broken symlink
Python Version
3.9.18
Django Version
4.1.13
Package Version
6.7.0
Description
A few days ago an unfortunate chain of events lead to a script producing a broken symlink in my staticfiles path, a subsequent automatic reload of the server caused whitenoise to update its file dict, ultimately leading to a FileNotFoundError in scantree() and crashing the whole thing.
I propose exception handling and a warning in https://github.com/evansd/whitenoise/pull/604
Not sure if there is a better way to test the broken symlink, other than committing one :thinking:
Per comment on the issue, I am not convinced Whitenoise should hide this error. Maybe if others encounter it, we can reopen and discuss.