"bzr branch-history | more" fails with UnicodeEncodeError

Bug #352006 reported by Samuel Bronson
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
BzrTools
Confirmed
Undecided
Unassigned

Bug Description

bronson@fry:~/devel/emacs$ bzr branch-history | more
bzr: ERROR: exceptions.UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 6: ordinal not in range(128)

Traceback (most recent call last):
  File "/home/noncsci/bronson/lib/python/bzrlib/commands.py", line 727, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/home/noncsci/bronson/lib/python/bzrlib/commands.py", line 922, in run_bzr
    ret = run(*run_argv)
  File "/home/noncsci/bronson/.bazaar/plugins/bzrtools/command.py", line 13, in run_argv_aliases
    commands.Command.run_argv_aliases(self, argv, alias_argv)
  File "/home/noncsci/bronson/lib/python/bzrlib/commands.py", line 559, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/noncsci/bronson/.bazaar/plugins/bzrtools/command_classes.py", line 357, in run
    return branch_history(branch)
  File "/home/noncsci/bronson/.bazaar/plugins/bzrtools/branchhistory.py", line 20, in branch_history
    print_info(descriptor, start, revno - 1)
  File "/home/noncsci/bronson/.bazaar/plugins/bzrtools/branchhistory.py", line 61, in print_info
    print descriptor_string
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 6: ordinal not in range(128)

bzr 1.14dev on python 2.5.2 (linux2)
arguments: ['/home/noncsci/bronson/bin/bzr', 'branch-history']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.utf8'
plugins:
  bzrtools /home/noncsci/bronson/.bazaar/plugins/bzrtools [1.14]
  launchpad /home/noncsci/bronson/lib/python/bzrlib/plugins/launchpad [unknown]
  netrc_credential_store /home/noncsci/bronson/lib/python/bzrlib/plugins/netrc_credential_store [unknown]
  svn /home/noncsci/bronson/.bazaar/plugins/svn [0.5.4dev]
*** 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.

Revision history for this message
Samuel Bronson (naesten) wrote :

Oh, btw, I was working in a clone of http://bzr.notengoamigos.org/emacs-merges/trunk/

Revision history for this message
Bojan Nikolic (bojan-bnikolic) wrote :

Still is still a problem for the Emacs repo:

http://permalink.gmane.org/gmane.emacs.devel/118133

Revision history for this message
Bojan Nikolic (bojan-bnikolic) wrote :

Maybe something as simple as attached will fix the problem?

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.

Changed in bzrtools:
status: New → Confirmed
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.