Author jaraco
Recipients asvetlov, brian.curtin, flox, jafo, jaraco, loewis, r.david.murray, techtonik, tim.golden
Date 2010-04-11.14:24:49
SpamBayes Score 1.30112e-06
Marked as misclassified No
Message-id <1270995892.41.0.408226566261.issue7443@psf.upfronthosting.co.za>
In-reply-to
Content
When I was working on a routine to checkout/patch/build/test/cleanup Python (see https://svn.jaraco.com/jaraco/python/jaraco.develop, and particularly scripts/test-windows-symlink-patch.py), I ran into a similar problem during the cleanup step. I tried using shutil.rmtree to clean up the folder that was checked out, but I repeatedly got 'access denied' exceptions.

I ended up working around the problem by using subprocess and cmd.exe's "rmdir /s /q".

I think this demonstrates three facets to this problem:

1) It doesn't just affect the test suite. It happens to other Python programs that are using shutil.rmtree (and possibly remove/unlink) to remove files that are in use.

2) It doesn't have to be that way. At the very least, there could (should?) be a function in Python that replicates 'rmdir /s /q', which is not subject to the 'access denied' error.

3) We could use subprocess and cmd.exe to perform the unlink and rmtree operations in the test suite to bypass the transient failures until Python supports the behavior natively.
History
Date User Action Args
2010-04-11 14:24:52jaracosetrecipients: + jaraco, loewis, jafo, techtonik, tim.golden, r.david.murray, brian.curtin, asvetlov, flox
2010-04-11 14:24:52jaracosetmessageid: <1270995892.41.0.408226566261.issue7443@psf.upfronthosting.co.za>
2010-04-11 14:24:50jaracolinkissue7443 messages
2010-04-11 14:24:49jaracocreate