On 1 Apr, 21:06, Tim Golden <[EMAIL PROTECTED]> wrote: > Giampaolo Rodola' wrote: > > > On 1 Apr, 18:27, "Steven Bethard" <[EMAIL PROTECTED]> wrote: > >> On Tue, Apr 1, 2008 at 10:20 AM, Facundo Batista > > >> <[EMAIL PROTECTED]> wrote: > >>> 2008/4/1, Tim Golden <[EMAIL PROTECTED]>: > >>> > If this is the thing to do, presumably test_support should > >>> > grow a "remove_file" which does something of this sort? > >>> +1 (I was thinking exactly that). > >> +1 here too. That looks like a great solution. Of course, once it's > >> in test_support, we need to fix *all* file removals in the test suite. > >> ;-) > > >> Steve > > > Why not just modifying test_support.unlink() like this? > > Surely more convenient than modifying the whole suite. > > > def unlink(filename): > > try: > > if os.name == 'nt': > > os.rename(filename, filename + ".deleted") > > filename = filename + ".deleted" > > os.unlink(filename) > > except OSError: > > pass > > Funnily enough, that's exactly what the patch I've > put together does.
Sorry but maybe I misunderstood what you said above. It seems to me you proposed to add a new "remove_file" function to test_support while the solution I suggested was modifying the current test_support.unlink() function in a similar manner you proposed and have all tests use it wherever it is possible. _______________________________________________ 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