[merge] make "bzr testament" work with unicode commit messages
Marien Zwart
marienz at gentoo.org
Thu Feb 16 16:57:45 GMT 2006
On Mon, Feb 13, 2006 at 04:09:39PM +0100, Marien Zwart wrote:
> On Mon, Feb 13, 2006 at 06:10:29PM +1100, Robert Collins wrote:
> > The test is currently faulty - it checks for unicode equivalence, not
> > for utf8 equivalence.
> >
> > The check should be an assert for equality of two '.encode('utf8')'ed
> > byte sequences, not of unicode strings.
>
> That's what it is doing: there is a .encode('utf-8') hidden at the end
> of the REV_UNICODE_COMMIT_TESTAMENT definition, and my patch makes
> as_text_lines return utf8-encoded byte sequences, instead of the
> unicode objects it returned previously. Unless how .encode('utf-8')
> encodes things changes this should work.
>
> If you think it's better I can replace the definition of
> REV_UNICODE_COMMIT_TESTAMENT with a hardcoded byte string instead of
> letting python utf8-encode a hardcoded unicode object.
(shamelessly "bumping" my own thread :P)
Based on a suggestion from Robert Collins I made it a bit more
explicit that the test is comparing bytestrings instead of unicode
objects by moving the .encode into the test itself. Is this ok now or
does it need further changes/improvements?
--
Marien.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060216/9a3ad142/attachment.pgp
More information about the bazaar
mailing list