-
-
Notifications
You must be signed in to change notification settings - Fork 699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FileSystemEventHandler cannot detect changes of files in Windows drives when running from WSL 2 #1072
Comments
I faced the same issue with FileSystemEventHandler in Windows. How I can use Polling Observer |
Just replace |
PollingObserver() was not accepted, belongs this CMD to a different interpreter then watchdog? |
@BornKrefeld, are there any error messages? |
this is my error message: Process finished with exit code 1 this was my coding around PollingObserver: event_handler = MyEventHandler() |
You forgot to import |
NOTE: The issue here is beyond the control of the library authors, so treat this issue as a warning.
Issue
I tried making a program that watches for file changes in a Windows drive. Assume that I have the following file structure, where
watchdog_test.py
is the main Python script:watchdog_test.py
has the following code:For some reason, it sometimes detects file changes when trying to check the current directory (
path
for theObserver
is set to'.'
), but not when watching a specific path (just like above). This code, however, works fantastically when running in Windows watching paths in Windows drives (e.g.C:
), as well as in Linux (WSL) watching paths in the WSL drives.Cause
This issue is caused by the lack of support of file notification support in the 9P protocol servers in Windows and WSL[1], which does affect inotify, which
watchdog
uses in Linux. This preventswatchdog
from watching changes in Windows drive paths inside WSL.Workaround
Use
PollingObserver
when you're trying to watch files in Windows drives from WSL.Possible Action Plan
Since this issue is practically unfixable until complete inotify support for files in Windows drives is added, the documentation might have to be updated to let users know about this issue.
References
[1] - https://youtu.be/lwhMThePdIo?si=NW7fBHIQN7iOosKR&t=3166
The text was updated successfully, but these errors were encountered: