[issue33240] shutil.rmtree fails if inner folder is open in Windows Explorer

2021-03-20 Thread Eryk Sun
Eryk Sun added the comment: > oh, I missed that a notification happens to the other process(es) in a > common case, a bit of retrying with backoff would actually make sense The other common problem with deleting an empty directory is when it's opened as the working directory of a process.

[issue33240] shutil.rmtree fails if inner folder is open in Windows Explorer

2021-03-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: oh, I missed that a notification happens to the other process(es) in a common case, a bit of retrying with backoff would actually make sense there. But I wouldn't let a retry run for longer than a second or three, as code tends to assume that rmtree is

[issue33240] shutil.rmtree fails if inner folder is open in Windows Explorer

2021-03-20 Thread Eryk Sun
Eryk Sun added the comment: > Isn't this just "how windows behaves" on some filesystems with > little that we can do about it? The suggestion was to include an error handler that retries unlink() and rmdir() -- particularly rmdir() -- a given number of times, probably with an exponential

[issue33240] shutil.rmtree fails if inner folder is open in Windows Explorer

2021-03-20 Thread Gregory P. Smith
Gregory P. Smith added the comment: Isn't this just "how windows behaves" on some filesystems with little that we can do about it? The only real action item I can see here is that if it is _reasonable_ for us to detect the situation and improve the error message, that'd help the users (and

[issue33240] shutil.rmtree fails if inner folder is open in Windows Explorer

2021-03-17 Thread Eryk Sun
Change by Eryk Sun : -- components: -IO ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33240] shutil.rmtree fails if inner folder is open in Windows Explorer

2021-03-17 Thread Eryk Sun
Eryk Sun added the comment: > Explorer keeps handles open to directories to get updates via > ReadDirectoryChangesExW. It opens watched directories with > shared delete access, so deleting the child succeeds. But as > discussed above, the directory isn't unlinked from the parent > until

[issue33240] shutil.rmtree fails if inner folder is open in Windows Explorer

2020-04-04 Thread Ofek Lev
Ofek Lev added the comment: > For convenience, a handler that retries unlink() and rmdir() could be > distributed with shutil. For ease of use, it could be enabled by default on > Windows. Any update on that? I just spent a bunch of time debugging this on Windows. -- nosy:

[issue33240] shutil.rmtree fails if inner folder is open in Windows Explorer

2018-04-13 Thread Terry J. Reedy
Change by Terry J. Reedy : -- title: shutil.rmtree fails when the inner floder is opened in Explorer on Windows -> shutil.rmtree fails if inner folder is open in Windows Explorer ___ Python tracker