Unicode error on Windows

Philippe Lhoste PhiLho at GMX.net
Wed Jul 8 22:49:17 BST 2009


I just hit a bug, I don't know if I must report it as suggested by the 
message.

 > bzr ls
.bzrignore
AddMarkItUp/
Base64.bat
GM_UseRemoteLibrary.user.js
GoogleTest.user.js
bzr: ERROR: exceptions.UnicodeEncodeError: 'charmap' codec can't encode 
character u'\u2013' in position 36: character maps to <undefined>

Traceback (most recent call last):
   File "bzrlib\commands.pyo", line 729, in exception_to_return_code
   File "bzrlib\commands.pyo", line 924, in run_bzr
   File "bzrlib\commands.pyo", line 560, in run_argv_aliases
   File "bzrlib\commands.pyo", line 939, in ignore_pipe
   File "bzrlib\builtins.pyo", line 2436, in run
   File "codecs.pyo", line 303, in write
   File "encodings\cp850.pyo", line 12, in encode
UnicodeEncodeError: 'charmap' codec can't encode character u'\u2013' in 
position 36: character maps to <undefined>

bzr 1.16 on python 2.5.2 (win32)
arguments: ['bzr', 'ls']
encoding: 'cp1252', fsenc: 'mbcs', lang: None
plugins:
   bzrtools             C:\PrgCmdLine\Bazaar\plugins\bzrtools [1.16]
   explorer             C:\PrgCmdLine\Bazaar\plugins\explorer [0.4]
   extcommand 
D:\_PhiLhoDocs\Settings\bazaar\2.0\plugins\extcommand [unknown]
   extmerge 
D:\_PhiLhoDocs\Settings\bazaar\2.0\plugins\extmerge [unknown]
   fastimport 
D:\_PhiLhoDocs\Settings\bazaar\2.0\plugins\fastimport [unknown]
   launchpad            C:\PrgCmdLine\Bazaar\plugins\launchpad [1.16]
   netrc_credential_store 
C:\PrgCmdLine\Bazaar\plugins\netrc_credential_store [1.16]
   qbzr                 C:\PrgCmdLine\Bazaar\plugins\qbzr [0.11]
   rebase               C:\PrgCmdLine\Bazaar\plugins\rebase [0.5]
   svn                  C:\PrgCmdLine\Bazaar\plugins\svn [0.6.1]
   xmloutput 
D:\_PhiLhoDocs\Settings\bazaar\2.0\plugins\xmloutput [0.8.3]
*** Bazaar has encountered an internal error.
     Please report a bug at https://bugs.launchpad.net/bzr/+filebug
     including this traceback, and a description of what you
     were doing when the error occurred.

I have a file, which I versioned using a previous version of Bazaar 
(1.13 perhaps), which is actually an Internet link (.URL file):

How do I use @require and @resource – Userscripts.org

The dash is actually U+2013 EN DASH (according to BabelMap), ie. a long 
dash (longer than the classical hyphen.

The issue comes from the Windows XP console, I suppose: Bazaar use cp850 
(DOSLatin1), while the file name is encoded using CP1252.

If I do 'ls', the name is displayed as:

How do I use @require and @resource û Userscripts.org.URL

I have no problem with regular CP1252 characters (French accents) but it 
doesn't like high Unicode.

Note: I can reproduce that with 1.16-1: I can add a file with U+2032 for 
example, but ls crashes on it.

-- 
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --




More information about the bazaar mailing list