[MERGE] Solution for Bug 135320 UnicodeDecodeError
Müller-Reineke, Matthias
matthias.mueller-reineke at grundvers.de
Mon Mar 31 11:53:37 BST 2008
Hi,
a german umlaut in a file name makes it impossibble to merge two branches with bzr 1.1 (see Bug 135320). This seems to solve the problem:
=== modified file 'bzrlib/dirstate.py'
--- bzrlib/dirstate.py 2008-03-06 18:21:43 +0000
+++ bzrlib/dirstate.py 2008-03-31 10:33:56 +0000
@@ -1922,7 +1922,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
What do you think about it?
Unfortunately I didn't understand the purpose of DirState exactly so I don't know how to create a correct module test for my bug and it's solution.
Matthias Müller-Reineke
------------------------------------------
Grundeigentümer-Versicherung VVaG
Große Bäckerstraße 7
20095 Hamburg
Tel: +4940 - 3 76 63 - 199
Fax: +4940 - 3 76 63 - 98 199
http://www.grundvers.de
<mailto:matthias.mueller-reineke at grundvers.de>
Firmensitz: Hamburg HRB 13 103
Vorstand: Heinz Walter Berens (Vors.), Rüdiger Buyten
Aufsichtsratsvorsitzender: Peter Landmann
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 135320-UnicodeDecodeError.patch
Type: application/octet-stream
Size: 1267 bytes
Desc: 135320-UnicodeDecodeError.patch
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080331/d9432cca/attachment.obj
More information about the bazaar
mailing list