[bug] bundle creation problems

holger krekel holger at merlinux.de
Fri Aug 11 14:46:12 BST 2006


Hi folks, 

while playing with bundle parsing, I noticed that 

    bzr bundle -r 1..-1 --output=test.bundle 

on current bzr.dev (1912 revisions) fails with: 

    ... 
    File "bzrlib/testament.py", line 144, in as_text_lines
        return [line.encode('utf-8') for line in r]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 10: ordinal not in range(128)

where the 'line' in question is created by _revprops_to_lines 
which encodes non-ascii characters in utf8 - and then the
attempt in as_text_lines to encode again fails (depends
on the locale default encoding).  The attached patch fixes 
this particular problem. 

However, after applying this fix the above bundle creation 
then leads to this problem: 

    bzr: ERROR: Revision {john at arbash-meinel.com-20050709180338-33e3b5a778df9104} not
    present in inventory.  

what to do about this?   

best, 
   
    holger

-------------- next part --------------
=== modified file 'bzrlib/testament.py'
--- bzrlib/testament.py	2006-07-21 01:37:47 +0000
+++ bzrlib/testament.py	2006-08-11 11:48:46 +0000
@@ -183,9 +183,7 @@
             assert not contains_whitespace(name)
             r.append('  %s:\n' % name)
             for line in value.splitlines():
-                if not isinstance(line, str):
-                    line = line.encode('utf-8')
-                r.append('    %s\n' % line)
+                r.append(u'    %s\n' % line)
         return r
 
     def as_sha1(self):



More information about the bazaar mailing list