Possible fix, and a new bug for [Re: self-hosting repo available]

Martin Pool mbp at sourcefrog.net
Fri Apr 15 10:20:25 BST 2005


On Mon, 2005-04-11 at 19:55 +1000, Andrew Bennetts wrote:
> On Mon, Apr 11, 2005 at 11:15:50AM +0200, Erik Bågfors wrote:
> > Ok, found out what caused this.  It's the 'å' in my last name in
> > bzrlib.osutils.username().  By doing EMAIL="Erik Bagfors
> > <erik at bagfors.nu>" it works.  But that's not my name :)
> > 
> > Some UTF8 problems here.  My system is all UTF8 (inclu /etc/passwd).
> 

> Here's a possible fix, with hackish test-case... except that the diff seems to
> be broken... bzr diff has trouble with files that don't end with newlines,
> maybe? 

Rather, difflib.unidiff has trouble...  I need to add a workaround.

> # check that bzr copes with non-ascii BZREMAIL settings
> +BZREMAIL=`python -c "import sys, locale; sys.stdout.write(unichr(0xc3).encode(locale.getpreferredencoding()))"` bzr help

Unfortunately this will abort if the user's locale encoding is not one
that can represent that character, such as with LANG=C on Ubuntu.
Unfortunate because unicode-correctness is not going to just happen but
it needs to be tested hard.

One way would be to set LANG for the tests, but that may fail on some
systems if they can't handle whatever it's set to.  And anyhow, I am
interested in hearing about environment-dependent test failures.

Perhaps the best way is to make the test data be non-ASCII if the user
environment allows. 

-- 
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/20050415/359e0e6f/attachment.pgp 


More information about the bazaar mailing list