You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setting exclude_patterns to an absolute path, e.g. /home/me/bar/*, works fine with StatReloaderLoop, and fails to exclude paths with WatchdogReloaderLoop. The root cause is that WatchdogReloaderLoop uses watchdog which relies on pathlib.PurePath.match and StatReloaderLoop relies on `fnmatch. Here's a simple demonstration:
Pathlib's behavior is too strict for this particularly problem, since it matches from the right for relative paths and exact matches for absolute paths. fnmatch finds first match from the left.
The workaround is to disable the watchdog by passing reloader_type="stat" to run_simple.
Environment:
Python version: 3.7.2
Werkzeug version: 2.0.3
The text was updated successfully, but these errors were encountered:
This sounds like a bug report for Watchdog, not Werkzeug. We don't appear to be calling PurePath.match in our reloader code, our code for exclude_patterns is the same between _find_stat_paths and _find_watchdog_paths, they both use fnmatch.
Setting
exclude_patterns
to an absolute path, e.g./home/me/bar/*
, works fine with StatReloaderLoop, and fails to exclude paths with WatchdogReloaderLoop. The root cause is that WatchdogReloaderLoop useswatchdog
which relies onpathlib.PurePath.match
and StatReloaderLoop relies on `fnmatch. Here's a simple demonstration:Pathlib's behavior is too strict for this particularly problem, since it matches from the right for relative paths and exact matches for absolute paths. fnmatch finds first match from the left.
The workaround is to disable the watchdog by passing
reloader_type="stat"
torun_simple
.Environment:
The text was updated successfully, but these errors were encountered: