[Python-Dev] fixing tests on windows

Tim Golden mail at timgolden.me.uk
Tue Apr 1 17:20:46 CEST 2008

Steven Bethard wrote:
> At the sprints, I ran into a bunch of similar errors running the test
> suite on my Windows Vista box, even on tests that were properly
> cleaning up after themselves in tearDown(). I even tried putting in
> sleeps as long as 1 second, to no avail. The only way to get the test
> suite to run without these errors was to stop the Windows Search
> Service, fully disable Icon Overlays for TortoiseSVN, and then close
> down all open folders.
> Any chance the boxes the tests are being run on are running the
> Windows Search Service or have Icon Overlays enabled for TortoiseSVN?
> (If anyone has any ideas of how to get around these problems, I'd love
> to hear them. Seems like I shouldn't have to disable these services.)

I'm not sure I'm going to help here, but the reason that
this happens is that certain services -- and the Desktop
Search tools are notorious for this -- get file handles with
FILE_SHARE_DELETE, which means that the file isn't actually
removed when it's deleted; only when the last of those handles

I did see a suggestion somewhere that, to circumvent this issue,
instead of removing it a file you need to move it to %TEMP%
(or wherever) and delete it there. I'll try to knock up a test
case to see if this works.


More information about the Python-Dev mailing list