error in the tests

Martin Pool mbp at sourcefrog.net
Fri Jan 6 02:05:31 GMT 2006


On Thu, 2006-01-05 at 12:21 -0600, John Arbash Meinel wrote:

> I was able to reproduce the problem just by adding the line:
> os.environ['BZREMAIL'] = u'Erik Bågfors <joe at foo.com>'.encode('utf-8')
> 
> Before the rest of the test. The specific traceback is because when we
> capture the output of bzr, we basically are just setting sys.stdout to a
> StringIO object, which has an encoding of 'ascii'. This means that there
> is no valid encoding.
> 
> For something like 'missing' or 'log', it is probably okay if the output
> gets slightly corrupted when characters are not representable in the
> current character set.

There was some discussion of this previously - for those "display"
commands we probably want to write to stdout in errors=replace mode, so
that you can still get "Erik B?gfors" on an ascii terminal.  For other
cases, such as writing a diff, replacement is probably not acceptable.

> I'm thinking to change the run_bzr() code, so that it defaults to
> creating a 'utf-8' encoded file for sys.stdout. But that we can pass a
> command such as self.run_bzr(encoding='ascii', retcode=1) to change what
> the default encoding of sys.stdout is.
> That should mean generic tests don't fail for Eric, while still letting
> us write tests that make sure bzr doesn't fail under those conditions.

I take it you mean the run_bzr used in tests, not the overall entry
point for bzr?  I think being able to set the overall encoding for bzr
would be good, but I don't know if it'd be good to default to utf8.

There was some discussion of adding global options to control it; did
anything come of that?

-- 
Martin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060106/587a66c0/attachment.pgp 


More information about the bazaar mailing list