-
-
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
silently fails if path is file #1034
Comments
What OS? |
I see this behavior on Windows 11 as well. |
Could you post your code to reproduce the silent fail? |
…ssue by testing if it's a file.
I was able to reproduce this with the same results on Windows 11, I like the idea of supporting events on single files, is that something that would be in line with the project's goals? update: clarification, in the test I am specifying a file, not dir |
Yes! I see you already wrote some code :) |
handle is someone else - we were just overlapped with the responses. |
Need some more time because of vacation. Was still looking for some end to end test but didn't found anything. Am I right? |
Testcases are now added. Let me know if it's okay. Run on Win 10 and Ubuntu 24.04 without problems. |
Having written my code in a rush, I set the path to be a file rather than a directory.
The code runs without warnings or errors, but fails to report modifications to the file.
It seems watchdog supports only monitoring directories, not individual files.
I suggest watchdog should either:
A) support events on a single file (perhaps this can be done simply by monitoring its directory and ignoring changes on everything that isn't that file)
This solution seems more ergonomic from user POV.
Alternatively,
B) If given path is file, throw an exception and say it must be a directory
(Please forgive me if I've overlooked something, I haven't had time to take a proper look at how watchdog works yet.)
The text was updated successfully, but these errors were encountered: