[MERGE] Make annotate behave in a non-ASCII world
Aaron Bentley
aaron.bentley at utoronto.ca
Fri Jul 6 18:37:39 BST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Adeodato Simó wrote:
> I think this, or some other solution, is a must have, even if everybody
> prefers gannotate these days. ;-)
> + try:
> + to_file.write(anno)
> + except UnicodeEncodeError:
> + to_file.write(anno.encode(to_file.encoding, 'replace'))
Could you say why you're trying and catching the exception here? I
think it would be better to encode the string unconditionally.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGjn3i0F+nu1YWqI0RArrNAJ9Yr/9IEOlpUQWCp15rb0b8WIr4FwCcDy+E
LHJSp4UwiOU1vTvYwh6QSNU=
=eVUr
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list