What's the issue?
watchdog 5.0 introduced a new signal that is fired when a file gets closed without any changes written.
This leads to random reloads when something opens and closes a file. opened events are already ignored, so we should ignore the new closed_no_write events too.
How to reproduce?
Update to watchdog 5.0+ and wait for the reloads to come in.
What's the expected behavior?
Werkzeug should only reload if there are actual changes to the code base.
Environment
- Python version: 3.11.2
- Werkzeug version: 3.0.4
- watchdog version: 5.0.2