[Python-3000] Py3k_struni additional test failures under cygwin

Joe Smith unknown_kev_cat at hotmail.com
Tue Jul 31 19:21:41 CEST 2007


""Martin v. Löwis"" <martin at v.loewis.de> wrote in message 
news:46AE5A9C.5000103 at v.loewis.de...
> Guido van Rossum schrieb:
>>> I found that in many cases, this is a virus scanner or the indexing
>>> service interfering. They open the file, and then the test suite cannot
>>> delete it.
>>
>> Oh darn. I remember running into that in a completely different
>> context. What's the solution? Turn off the virus scanner? Wait until
>> it's done?
>
> I never found the time to properly research the official solution.
>
> Looking at the DeleteFile documentation, the problem is slightly
> different, still: "The DeleteFile function marks a file for deletion on
> close. Therefore, the file deletion does not occur until the last handle
> to the file is closed. Subsequent calls to CreateFile to open the file
> fail with ERROR_ACCESS_DENIED."
>
> So it is not the DeleteFile that fails, but the subsequent attempt
> to create a new file in the same place.
>
> For the test suite, the solution would be to always use a fresh file
> name for temporary files. Of course, it is then more important that
> all files created actually do get removed in the fixture.

Hmm... The documentation for Cygwin's unlink() implies that it should 
function the same as a POSIX unlink() except perhaps if a non-Cygwin process 
has an open handle for it without the correct attributes. I see nothing on 
my system that would have done that. (No indexing service or virus scanner) 
So that implies that at the time Python is trying to create the file, it 
still has an open handle for it. Either that, or something besides Python is 
opening the file without my knowledge.





More information about the Python-3000 mailing list