Mojibake when showing localised exception messages

Bug #909152 reported by IWATA Hidetaka
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Triaged
High
Unassigned

Bug Description

Under the Windows + bzr 2.5
If we apply i18n to messages used by exceptions, they can't be printed to the console
correctly.

For example:
  Without i18n
    $ bzr log --author=xxx
    bzr: ERROR: Bad value "xxx" for option "authors".

  With i18n
    $ bzr log --author=xxx
    bzr: ERROR: 繧ェ繝励す繝ァ繝ウ "authors" 縺ォ蟇セ縺吶k荳肴ュ」縺ェ蛟、 "xxx"

Is this a problem to be fixed ? Or should we avoid translate messages used by exceptions ?

Output of bzr version:
  Bazaar (bzr) 2.5b4
    Python interpreter: C:\DEVELOP\py_envs\bzr2.5-mingw\Scripts\python.exe 2.7.2
    Python standard library: C:\DEVELOP\py_envs\bzr2.5-mingw\lib
    Platform: Windows-7-6.1.7601-SP1
    bzrlib: C:\DEVELOP\py_envs\bzr2.5-mingw\lib\site-packages\bzrlib
    Bazaar configuration: C:/Users/iwata/AppData/Roaming/bazaar/2.0
    Bazaar log file: C:\Users\iwata\Documents\.bzr.log

Related branches

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

I believe mgz did some work on this, but I'm not sure about the details. I do think this is an important problem that should be fixed.

Changed in bzr:
status: New → Triaged
importance: Undecided → High
tags: added: i18n
Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 909152] [NEW] Mojibake in exceptions.

IWATA Hidetaka пишет:
> Public bug reported:
>
> Under the Windows + bzr 2.5
> If we apply i18n to messages used by exceptions, they can't be printed to the console
> correctly.
>
> For example:
> Without i18n
> $ bzr log --author=xxx
> bzr: ERROR: Bad value "xxx" for option "authors".
>
> With i18n
> $ bzr log --author=xxx
> bzr: ERROR: 繧ェ繝励す繝ァ繝ウ "authors" 縺ォ蟇セ縺吶k荳肴ュ」縺ェ蛟、 "xxx"
>
> Is this a problem to be fixed ? Or should we avoid translate messages
> used by exceptions ?

That's because wrong encoding used. It should be fixed in core.

Martin Packman (gz)
summary: - Mojibake in exceptions.
+ Mojibake when showing localised exception messages
Revision history for this message
Martin Packman (gz) wrote :

See bug 777996 for the same issue in qbzr, and bug 273978 for a related weakness with the exception formatting code. The basic problem is BzrError.__str__ does encodes as utf-8 unconditionally, and trace.print_exception uses that rather than BzrError.__unicode__ and then encoding appropriately.

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.