Tim Golden <m...@timgolden.me.uk> added the comment:

For clarity, while making unlink more robust is no bad thing, the error occurs 
when the unlink *succeeds* but a subsequent create of the same name fails. This 
happens when an indexer, Virus scanner or TortoiseSvn etc. has opened the file 
with SHARE_DELETE. This allows a DeleteFile to succeed but continues to hold an 
open handle on the file. A following test which uses an identically named file 
(such as the global TESTFN) will fail if not enough time has elapsed for the 
background process to release its handle. A good candidate to see this in 
action is the test for tarfile.

I did start to undertake a conversion of TESTFN to a named temporary, but it 
started to sprawl all over the place and came up against a number of corner 
cases (eg where tests deliberately wanted two filenames to be the same) so I 
gave up.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7443>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to