[MERGE] [BUG 363837] Catch OSError to make diff log debug message instead of passing win32 specific exception to stderr

Martin Pool mbp at sourcefrog.net
Thu May 14 09:21:55 BST 2009


2009/5/14 Maritza Mendez <martitzam at gmail.com>:
>
>
> On Wed, May 13, 2009 at 8:02 PM, Martin Pool <mbp at sourcefrog.net> wrote:
>>
>>
>> My thinking was that changing the permissions on a file would possibly
>> exercise the same error but be easier to test.
>
> I thought of that also, as the simplest way of holding a file.  This would
> have to be done after the file is created but before diff tries to remove
> it.  I thought of two ways to do this.  Either manually (not a great choice
> for an automated test) or an external process watches for the creation of
> the temp directory, accesses it and waits indefinitely.  I assumed (maybe
> wrong) that this would not lend itself to testing.  I probably should have
> asked.

Ah, ok.  So, testing this within diff may be slightly complicated, but
you can put it into an osutils function or an option to rmtree, call
that from diff, and test it without the timing issues at the osutils
level.

-- 
Martin <http://launchpad.net/~mbp/>



More information about the bazaar mailing list