Gregory P. Smith wrote:
> On Tue, Apr 1, 2008 at 9:13 AM, Tim Golden <[EMAIL PROTECTED]> wrote:
> 
>> Tim Golden wrote:

>> <code>
>> import os, sys
>> import win32file
>>
>> FILENAME = "test"
>>
>> def rename_and_remove (filename):
>>   os.rename (filename, filename + ".deleted")
>>   os.remove (filename + ".deleted")

> Isn't this still going to run into problems when the rename fails because
> the earlier tests remove still left the .deleted file around due to some
> other running desktop search service that now has the .deleted file open?

I admit: this did occur to me on the train this am. While I
try to think of a robust way to handle this, other people have
proposed variations on pid-based / tempdir based filenames instead
of the same name for each test. In principle this sounds good to me,
but I'm not at all well-placed to assess the impact it might have
on the unit tests in general.

TJG
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to