Author max
Recipients max
Date 2017-04-04.18:26:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1491330378.49.0.274398190766.issue29982@psf.upfronthosting.co.za>
In-reply-to
Content
There's a known issue with `shutil.rmtree` on Windows, in that it fails intermittently. 

The issue is well known (https://mail.python.org/pipermail/python-dev/2013-September/128353.html), and the agreement is that it cannot be cleanly solved inside `shutil` and should instead be solved by the calling app. Specifically, python devs themselves faced it in their test suite and solved it by retrying delete.

However, what to do about `tempfile.TemporaryDirectory`? Is it considered the calling app, and therefore should retry delete when it calls `shutil.rmtree` in its `cleanup` method?

I don't think `tempfile` is protected by the same argument that `shutil.rmtree` is protected, in that it's too messy to solve it in the standard library. My rationale is that while it's very easy for the end user to retry `shutil.rmtree`, it's far more difficult to fix the problem with `tempfile.TempDirectory` not deleting itself - how would the end user retry the `cleanup` method (which is called from `weakref.finalizer`)?

So perhaps the retry loop should be added to `cleanup`.
History
Date User Action Args
2017-04-04 18:26:18maxsetrecipients: + max
2017-04-04 18:26:18maxsetmessageid: <1491330378.49.0.274398190766.issue29982@psf.upfronthosting.co.za>
2017-04-04 18:26:18maxlinkissue29982 messages
2017-04-04 18:26:18maxcreate