Comment 4 for bug 352006

Revision history for this message
Alexander Belchenko (bialix) wrote :

This can be triggered even without |more, just try to run this command on the branch with non-ascii committer names in the shell where unicode is not supported. Here is example for qbzr repo running in std russian windows shell:

C:\work\Bazaar\plugins\qbzr>bzr branch-history
bzr: ERROR: exceptions.UnicodeEncodeError: 'charmap' codec can't encode characters in position 3-4: character maps t
o <undefined>

Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 842, in exception_to_return_code
  File "bzrlib\commands.pyo", line 1037, in run_bzr
  File "C:/Program Files/Bazaar/plugins\bzrtools\command.py", line 13, in run_argv_aliases
  File "bzrlib\commands.pyo", line 654, in run_argv_aliases
  File "C:/Program Files/Bazaar/plugins\bzrtools\command_classes.py", line 361, in run
  File "C:/Program Files/Bazaar/plugins\bzrtools\branchhistory.py", line 20, in branch_history
  File "C:/Program Files/Bazaar/plugins\bzrtools\branchhistory.py", line 61, in print_info
  File "encodings\cp866.pyo", line 12, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 3-4: character maps to <undefined>

bzr 2.0.2 on python 2.5.4 (Windows-XP-5.1.2600-SP3)
arguments: ['C:\\Program Files\\Bazaar\\bzr.EXE', 'branch-history']
encoding: 'cp1251', fsenc: 'mbcs', lang: 'ru'
plugins:
  acad C:\work\Bazaar\plugins\acad [0.8.0]
  bzrtools C:\Program Files\Bazaar\plugins\bzrtools [2.0.1]
  explorer C:\work\Bazaar\plugins\explorer [0.10.0dev]
  fastimport C:\work\Bazaar\plugins\fastimport [0.9.0dev]
  format1 C:\work\Bazaar\plugins\format1 [unknown]
  launchpad C:\Program Files\Bazaar\plugins\launchpad [2.0.2]
  qbzr C:\work\Bazaar\plugins\qbzr [0.17.0dev]
  rebase C:\work\Bazaar\plugins\rebase [0.5.4]
  repoalias C:\work\Bazaar\plugins\repoalias [unknown]
  scmproj C:\work\Bazaar\plugins\scmproj [0.5.0dev]
  svn C:\work\Bazaar\plugins\svn [1.0.2dev]
  x_bit C:\work\Bazaar\plugins\x_bit [1.0.0]

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

Using print for unicode data is very bad idea.