[MERGE][328007] Fixed problem with `log -p` and non-ascii content of files: show_diff should write the diff to exact [stdout] stream.

James Westby jw+debian at jameswestby.net
Thu Mar 12 01:31:36 GMT 2009


On Wed, 2009-03-11 at 11:03 +0200, Alexander Belchenko wrote:
> This patch provides fix for bug #328007: log -p on non-ascii files crashed with unicode error.
> I wrote this patch by Ian request (actually I wrote 2 variants of patch).
> Now I've added simple smoke test. This test failed with unicode error without my patch
> and succeed with it.

Thanks for working on this, I think it's an important bug to fix.

> +        # 'exact' stream used to show diff, it should print content 'as is'
> +        # and should not try to decode/encode it to unicode to avoid bug #328007
> +        self.to_exact_file = getattr(to_file, 'stream', to_file)

This seems to change the contract of the method, does it work if I pass
in a StringIO to receive the diff?

It seems to me like your first patch, while a little more verbose, 
didn't rely on an undocumented feature.

Thanks,

James




More information about the bazaar mailing list