Review this patch for merge encoding issue, please.

Joao Pedrosa joaopedrosa at gmail.com
Sat Nov 5 05:28:48 GMT 2005


Hi guys,

while trying to do a local merge between two branches I hit this issue:

[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 --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/bazaar/attachments/20051105/4f1eb733/attachment.htm 


More information about the bazaar mailing list