Review this patch for merge encoding issue, please.
John A Meinel
john at arbash-meinel.com
Sat Nov 5 06:16:29 GMT 2005
Joao Pedrosa wrote:
> Hi guys,
>
> while trying to do a local merge between two branches I hit this issue:
There is a general encoding issue that needs to be discussed for bzr.
This probably does fix your particular case, but we need to really go
through and check all of the input pieces, and all of the output pieces,
and make sure we are re-encoding things that need it to be done.
But we'll get there, and thanks for the bug report, and the reminder
that it needs to get done.
John
=:->
>
> [16257] Sat 00:27:41.283 ERROR: 'ascii' codec can't encode characters in
> position 24-29: ordinal not in range(128)
> command: '../../bzr.ab/bzr' 'ci'
> pwd: u'/home/dewd/t_/bzr/accents/repo1'
> error: exceptions.UnicodeEncodeError
> Traceback (most recent call last):
> File "/home/dewd/t_/bzr/bzr.ab/bzrlib/commands.py", line 531, in
> run_bzr_catch_errors
> return run_bzr(argv)
> File "/home/dewd/t_/bzr/bzr.ab/bzrlib/commands.py", line 506, in run_bzr
> ret = cmd_obj.run_argv(argv)
> File "/home/dewd/t_/bzr/bzr.ab/bzrlib/commands.py", line 225, in run_argv
> return self.run(**all_cmd_args)
> File "/home/dewd/t_/bzr/bzr.ab/bzrlib/builtins.py", line 1201, in run
> to_file=catcher)
> File "/home/dewd/t_/bzr/bzr.ab/bzrlib/status.py", line 101, in
> show_status
> print >> to_file, ' ', line_log(m_revision, 77)
> UnicodeEncodeError: 'ascii' codec can't encode characters in position
> 24-29: ordinal not in range(128)
>
>
> I may have found the following solution:
>
> === modified file 'bzrlib/status.py'
> --- bzrlib/status.py
> +++ bzrlib/status.py
> @@ -15,6 +15,7 @@
> # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
>
> import sys
> +import bzrlib
> from bzrlib.osutils import is_inside_any
> from bzrlib.delta import compare_trees
> from bzrlib.log import line_log
> @@ -98,7 +99,7 @@
> ignore.add(merge)
> try:
> m_revision = branch.get_revision(merge)
> - print >> to_file, ' ', line_log(m_revision, 77)
> + print >> to_file, ' ', line_log(m_revision,
> 77).encode(bzrlib.user_encoding)
> inner_merges = branch.get_ancestry(merge)
> inner_merges.reverse()
> for mmerge in inner_merges:
>
>
>
> Thanks.
>
> Cheers,
> Joao
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051105/d3c39759/attachment.pgp
More information about the bazaar
mailing list