version-info --include-history UnicodeDecodeError (518609)

John Arbash Meinel john at arbash-meinel.com
Fri Apr 9 16:45:25 BST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stephen J. Turnbull wrote:
> Robert Collins writes:
> 
>  > As already said in this thread, RIO isn't 'text', its a defined series
>  > of bytes.
> 
> I know.  So what about RIO?  We are talking about the version-info
> command, are we not?  Its help says
> 
>   You can use this command to add information about version into
>   source code of an application. The output can be in one of the
>   supported formats or in a custom format based on a template.
> 
> That's text, OK?  The source language gets to choose, NOT bzr.  Eg, if
> it's Python source, it's ISO 8859/1 by default through 2.x (IIRC) and
> UTF-8 in Python 3, but it can be anything supported by Python (see PEP
> 263).  If bzr is outputting RIO from that command, that's a bug.
> 
> Of course respecting the top-level locale is badly broken if the
> project uses PEP 263 coding cookies.  But I don't see what else you
> can do.

I believe that 'bzr version-info --format=python' outputs u'' strings
with unicode escapes. u'\u1234' and such. I won't say that it actually
does it correct, but that was the intent. So it should actually be
putting out *ascii* text for --format=python.

RIO is specifically UTF-8 as Robert mentioned.

I don't know that we spent a huge amount of time sorting through all of
this for all possible cases. I also don't know about python3 vs python2,
which would have an effect here. (revision_ids and file_ids are defined
to be utf-8 encoded 8-bit strings in memory, but paths, log messages,
authors, etc are all meant to be Unicode in memory.)

Ultimately the encoding should be determined by the output formatter. I
would guess most formatters haven't really been polished in that regard.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAku/S5UACgkQJdeBCYSNAANATgCgxUdZ0e3YdIk9TptO04WoiIRG
0y4AoKdjhk01aOfNX62lILkNMX1Tu0lA
=/NhQ
-----END PGP SIGNATURE-----



More information about the bazaar mailing list