"format_signature_validity" (in log.py) throws UnicodeEncodeError when signature contains non-ascii character
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
In Progress
|
Low
|
Unassigned |
Bug Description
When accessing a repository which has signed commits and where the name of the author contains non ASCII characters you will get an UnicodeEncodeError when trying to get the log if signature display is enabled.
E.g. you can try
bzr log --signatures lp:~pixeldrama/annis/restr_vis -r 973..975
or
bzr qlog lp:~pixeldrama/annis/restr_vis
(click on the revision 975 to get the error)
The problem is in bzrlib/log.py in the function "format_
if you change
-------
if result[0] == gpg.SIGNATURE_
return "valid signature from {0}".format(
if result[0] == gpg.SIGNATURE_
return "unknown key {0}".format(
-------
to
-------
if result[0] == gpg.SIGNATURE_
return u"valid signature from {0}".format(
if result[0] == gpg.SIGNATURE_
return u"unknown key {0}".format(
-------
everything works fine. This was tested with bazaar 2.5.1 in Ubuntu but the error also exists in lp:bzr
bzr version
=========
Bazaar (bzr) 2.5.1
Python interpreter: /usr/bin/python 2.7.3
Python standard library: /usr/lib/python2.7
Platform: Linux-3.
bzrlib: /usr/lib/
Backtrace from bzr.log
===================
Mi 2012-08-15 14:35:26 +0200
0.055 bazaar version: 2.5.1
0.055 bzr arguments: [u'qlog']
0.057 looking for plugins in /home/thomas/
0.063 looking for plugins in /usr/lib/
0.098 encoding stdout as sys.stdout encoding 'UTF-8'
0.315 opening working tree '/home/
7.913 Traceback (most recent call last):
File "/usr/lib/
f(*args, **kargs)
File "/usr/lib/
r = f(*args, **kargs)
File "/usr/lib/
revids, self.log_
File "/usr/lib/
pass_
File "/usr/lib/
revisions_
File "/usr/lib/
cached_
File "/usr/lib/
return "valid signature from {0}".format(
UnicodeEncodeError: 'ascii' codec can't encode character u'\xdf' in position 12: ordinal not in range(128)
Related branches
- Richard Wilbur: Disapprove (branch superceded)
- John A Meinel: Needs Fixing
-
Diff: 15 lines (+2/-2)1 file modifiedbzrlib/log.py (+2/-2)
description: | updated |
Changed in bzr: | |
importance: | Undecided → Low |
status: | New → In Progress |
That change looks like a good start, would you like propose it for merging? See this wiki page and the ones following on:
<https:/ /help.launchpad .net/Code>