-
-
Notifications
You must be signed in to change notification settings - Fork 704
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
Fix #514 #515
Fix #514 #515
Conversation
Thanks @rrzaripov! |
Also, we should check this is fixed for all patforms. |
e0b2ecc
to
90476cd
Compare
There's a potential error using 'in' and 'startswith'. Figure out a folder system like this: My folder: Action
My virtual folder after action: You should at least append the system separator at the end of the move_src_path to be sure that you are comparing the path: if _path.startswith(move_src_path + os.path.sep): |
@pablomartinezm good catch! I start rework this ASAP. |
c7fc0cf
to
8d5f60b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks you @rrzaripov. Just few adjusments proposed :)
8cfd007
to
b4a7699
Compare
@BoboTiG I'm reworked PR, your suggestions applied, thank you! I'm sorry, your suggestions from code review not included as additional commit, my mistake, just first time work with code review on github. |
Thanks @rrzaripov, I will merge it later in the day :) |
🤔 The test passes without the patch applied. Something is missing perhaps? |
@BoboTiG I have stuck with this. When similar test scenario running from console (as bash script), I get expected fail. When test running using pytest result is unexpectedly success. I'm still trying understand what going on, but this make me crazy. Bash script (venv) root@debian-9:/home/vagrant/watchdog# cat test.sh
python3 ./test.py > /tmp/log.txt &
p=$!
sleep 3
mkdir A
mkdir A/B
mv A A2
touch A2/B/example.txt
sleep 3
kill -KILL $p
cat /tmp/log.txt
rm -rf A2 Output
|
With my new suggestions, the test is failing. do you think it is more correct like that? |
da6d9c3
to
685051f
Compare
685051f
to
f3c8af0
Compare
991ff70
to
87dd988
Compare
@BoboTiG I'm reworked test and added separate test for Windows, because events sets very different in comparison with Linux. While testing, two interesting things was discovered.
|
5068e7d
to
caa9875
Compare
caa9875
to
858e7b4
Compare
@BoboTiG tests passed, PR ready to merge:-) |
Thank you very much @rrzaripov! |
This PR will fix the issue with observing on directory in recursive mode. When directory be moved, then new events for child directories and files still report old path.
This PR needs code review, I think this patch may to be done in more intelligent or elegant way.
Tests will be added in near time.