[Svnmerge] bug when trying to block/merge revision w/ encoded text that the terminal's locale cannot support

Brett Cannon brett at python.org
Sat Aug 15 16:01:11 PDT 2009


I was trying to do an ``svnmerg.py merge -rXXX`` the other day but
svnmerge.py kept erroring out when it was finishing up and doing its
last svnmerge-blocked setting (error is at the end of this email).
Turns out that the log message had a character encoded in UTF-8 while
svnmerge was trying to use the mac-roman encoding (probably because
that's what locale.gerpreferredencoding() returns). A potential fix
was suggested by one of the Python developers at
http://mail.python.org/pipermail/python-committers/2009-August/000608.html
in order to avoid encoding differences.

-Brett

> svnmerge.py merge -r74429t
property 'svnmerge-integrated' deleted from '.'.

property 'svnmerge-blocked' deleted from '.'.

--- Merging r74429 into '.':
C    Misc/NEWS
U    Misc/ACKS
U    Lib/test/test_pyexpat.py
U    Modules/expat/xmltok_impl.c
Summary of conflicts:
 Text conflicts: 1

property 'svnmerge-integrated' set on '.'

property 'svnmerge-blocked' set on '.'

Traceback (most recent call last):
 File "/Users/brett/.slash/python/svnmerge/svnmerge.py", line 2361, in
<module>
   main(sys.argv[1:])
 File "/Users/brett/.slash/python/svnmerge/svnmerge.py", line 2356, in main
   cmd(branch_dir, branch_props)
 File "/Users/brett/.slash/python/svnmerge/svnmerge.py", line 1810, in
__call__
   return self.func(*args, **kwargs)
 File "/Users/brett/.slash/python/svnmerge/svnmerge.py", line 1560, in
action_merge
   print >>f, construct_merged_log_message(opts["source-url"], revs),
 File "/Users/brett/.slash/python/svnmerge/svnmerge.py", line 1136, in
construct_merged_log_message
   message = get_commit_log(url, r)
 File "/Users/brett/.slash/python/svnmerge/svnmerge.py", line 1122, in
get_commit_log
   return recode_stdout_to_file("".join(out[1:]))
 File "/Users/brett/.slash/python/svnmerge/svnmerge.py", line 229, in
recode_stdout_to_file
   return u.encode(locale.getdefaultlocale()[1])
 File "/Users/brett/.slash/python/lib/python2.6/encodings/mac_roman.py",
line 12, in encode
   return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u0107' in
position 191: character maps to <undefined>


More information about the Svnmerge mailing list