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 Alexander Riccio
Recipients Alexander Riccio, paul.moore, steve.dower, tim.golden, zach.ware
Date 2020-04-01.22:15:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1585779323.08.0.697022705599.issue40143@roundup.psfhosted.org>
In-reply-to
Content
The "obvious" way to delete a directory tree on Windows is wrong. It's inherently racy, since deleting a file on Windows *doesn't actually delete it*, instead it marks the file for deletion. The system will eventually get around to deleting it, but under heavy load, this might be sometime after an attempt is made to delete the parent directory. I've seen this (windows error 145, directory is not empty) many times when running the testsuite, and it causes all kinds of intermittent failures.

The best way to do things correctly is kinda nuts, and is explained well by Niall Douglass here: https://www.youtube.com/watch?v=uhRWMGBjlO8&t=8m54s

In short, the correct way to do it involves moving each file to a randomly named file in %TEMP%, then deleting that, and then doing the same with each newly-empty directory.
History
Date User Action Args
2020-04-01 22:15:23Alexander Ricciosetrecipients: + Alexander Riccio, paul.moore, tim.golden, zach.ware, steve.dower
2020-04-01 22:15:23Alexander Ricciosetmessageid: <1585779323.08.0.697022705599.issue40143@roundup.psfhosted.org>
2020-04-01 22:15:23Alexander Ricciolinkissue40143 messages
2020-04-01 22:15:22Alexander Ricciocreate