-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Watched file no longer watched after a change #235
Comments
Just tested this on my mac. Works perfectly and no problems with tmux. Hmm. I should maybe also note that watchfiles was installed with pipx with things running in some kind of venv for python. I'm not familiar with how that works at all. It's the first I've come across this kind of thing. |
To try to find a workaround, I turned on force_polling:
It seemed to work for a bit but then I got errors. Here's the output:
|
Doing some more experimenting. Got a different error:
I'm making my edits to the file with vim. |
If I append to the file with a bash command like echo blah >> testfile, things works perfectly. I suspect this has something to do with how vim modifies/updates files. |
Ok, after searching the issue queue on vim, I found this: #215 Which led me to this: notify-rs/notify#394 So as best I can tell, this watchfiles isn't really going to work for me when watching a single file until some lower level issue in notify gets addressed. |
If the file gets deleted, it's not surprising watching stops. I would watch the entire directory with |
What I ended up doing is putting the file in a subdir and symlinking to it from the parent dir and then watching the subdir. |
When I use vi to edit and save the watched file, the lib give |
Description
If I watch a single file and then make a change to it, the changs is picked up by watchlist. However, the second time a change is made to a file, watchfiles seems to no longer notice. watchfiles seems to work fine when watching a directory.
Example Code
Watchfiles Output
Operating System & Architecture
Linux-6.1.0-10-cloud-amd64-x86_64-with-glibc2.36
#1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03)
Environment
using tmux
Python & Watchfiles Version
python: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0], watchfiles: 0.19.0
Rust & Cargo Version
No response
The text was updated successfully, but these errors were encountered: