This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients eryksun, giampaolo.rodola, paul.moore, steve.dower, tarek, tim.golden, yuliu, zach.ware
Date 2018-04-09.15:11:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1523286695.65.0.682650639539.issue33240@psf.upfronthosting.co.za>
In-reply-to
Content
Your case probably isn't due to a anti-malware filesystem filter. 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 Explorer closes its handle. Apparently it's not fast enough on the systems you tested.

As a workaround, you can define an onerror handler for use with shutil.rmtree() that retries the rmdir() call in a loop for up to a given timeout period, such as 10 ms. 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.
History
Date User Action Args
2018-04-09 15:11:35eryksunsetrecipients: + eryksun, paul.moore, giampaolo.rodola, tim.golden, tarek, zach.ware, steve.dower, yuliu
2018-04-09 15:11:35eryksunsetmessageid: <1523286695.65.0.682650639539.issue33240@psf.upfronthosting.co.za>
2018-04-09 15:11:35eryksunlinkissue33240 messages
2018-04-09 15:11:35eryksuncreate