Comment 2 for bug 135320

Revision history for this message
Matthias Müller-Reineke (matthias-mueller-reineke) wrote : Re: bzr merge - exceptions.UnicodeDecodeError

I've posted a merge request with a patch which seems to solve the bug on <email address hidden> .
Unfortunately there was no reply until now.

The following patch seems to solve the bug.
Unfortunately I don't understand enough about Bazzaar
* to write a test which reproduces the bug
* to write a test of this patch
Dear Edmundo, do you have a clue?

=== modified file 'bzrlib/dirstate.py'
--- bzrlib/dirstate.py 2007-12-19 08:12:34 +0000
+++ bzrlib/dirstate.py 2008-02-11 10:41:12 +0000
@@ -1839,7 +1839,7 @@
         """
         output_lines = [DirState.HEADER_FORMAT_3]
         lines.append('') # a final newline
- inventory_text = '\0\n\0'.join(lines)
+ inventory_text = '\0\n\0'.join(map(osutils.safe_utf8, lines))
         output_lines.append('crc32: %s\n' % (zlib.crc32(inventory_text),))
         # -3, 1 for num parents, 1 for ghosts, 1 for final newline
         num_entries = len(lines)-3