whitenoise icon indicating copy to clipboard operation
whitenoise copied to clipboard

FileNotFoundError during scantree() caused by broken symlink

Open fdemmer opened this issue 1 year ago • 1 comments

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:

fdemmer avatar Aug 26 '24 18:08 fdemmer

Per comment on the issue, I am not convinced Whitenoise should hide this error. Maybe if others encounter it, we can reopen and discuss.

adamchainz avatar Oct 28 '24 11:10 adamchainz