error in the tests

John Arbash Meinel john at arbash-meinel.com
Thu Jan 5 18:21:22 GMT 2006


John Arbash Meinel wrote:
> Erik Bågfors wrote:
> 

...

>>Well, there is no problem with that name is I just run bzr.  It's when
>>I run the test it fails.
>>
>>more info
>>

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.

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.

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060105/c1096cf2/attachment.pgp 


More information about the bazaar mailing list