Occasional OSError: [Errno 13] Permission denied on Windows

Alec Wysoker alecw at pobox.com
Thu Jan 5 17:26:15 CET 2006

Interesting theory.  I do have a virus scanner, and also Google Desktop
Search.  Sometimes I get this error when running a large suite of unit
tests.  Each unit test starts off  by cleaning the test output
directory, and failing if it can't do so.  I will see many (hundreds?)
tests fail because the file can't be removed, and then eventually the
file will get removed.  My feeling is that if a virus scanner or
desktop search were keeping the file open, that it would only do so
briefly.  On the other hand, when I'm running unit tests I'm chewing up
a lot of CPU so perhaps it takes longer in those cases.

If we assume that this theory is correct, then what is the solution?
Sleep for a little while and try again?

More information about the Python-list mailing list