MEDIUM SEVERITYCONFIRMED
Forward-slash .git paths not filtered on Windows (os.sep='\\' splits on backslash)
Package
watchfiles
Version
1.1.1
Verified
2026-03-28
Description
watchfiles filters `.git` paths by splitting on `os.sep` (backslash on Windows). Paths with forward slashes (e.g., `'C:/project/.git/config'`) are not split correctly — `'.git'` is not found in the resulting parts list and is not filtered. Git internal change events are delivered to watchers on Windows.
Reproduction
import os
# On Windows: os.sep = '\\'
'C:/project/.git/config'.lstrip('\\').split('\\')
# ['C:/project/.git/config'] — .git not in parts, not filtered