-
Notifications
You must be signed in to change notification settings - Fork 686
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
Python process can not delete folder that is being observed #570
Comments
Hello @Horiol, This is not a bug: Windows does not allow you to delete a file/folder being used elsewhere. |
@Horiol Please, can you tell us what version of Python and Windows used by you?
|
@BoboTiG in that case, why I am able to delete the folder using the windows file explorer while the python process is running? @rrzaripov Thanks for your interest, I'm using the following versions:
|
@rrzaripov Do you recommand any action to do on the watchdog code? @Horiol I do not have the answer, I am just aware that file deletion on Windows may be blocked in such cases |
@BoboTiG I want to discover this case by next steps:
|
All right, great 👍 :) |
@BoboTiG under linux, running test application with same scenario no exception is raised and the
Under Windows on the next (after deleting directory) calling
Possible something I was overlooked, please give me to know. And yes, I think PR is needed for getting identical behavior under Linux and Windows. |
…er stops and release handle to directory.
…er stops and release handle to directory.
When observed directory deleted, WindowsApiEmitter stops and release handle to directory. * Update remove self tests * Update src/watchdog/observers/winapi.py Co-Authored-By: Mickaël Schoentgen <contact@tiger-222.fr> * Fix flake8 error
If you try to delete a folder that is being observed by a python process using watchdog and then try to delete it using another python process the folder becomes unavailable until the watchdog process stops.
Steps to reproduce:
The text was updated successfully, but these errors were encountered: