fails to commit if commiter name's contains non-ascii characters

Bug #799212 reported by Jelmer Vernooij
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Critical
Vincent Ladeuil
bzr (Debian)
Fix Released
Unknown
bzr (Ubuntu)
Fix Released
High
Jelmer Vernooij

Bug Description

Reported in Debian bug 630913 (regression in beta4):

$ bzr commit
Committing to: bzr+ssh://<email address hidden>/bzr/pkg-python/python-defaults-debian/
modified dh_python2
bzr: ERROR: exceptions.UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 52: ordinal not in range(128)

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 930, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 1130, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 691, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 713, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/builtins.py", line 3293, in run
    lossy=lossy)
  File "/usr/lib/python2.6/dist-packages/bzrlib/decorators.py", line 217, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/workingtree_4.py", line 209, in commit
    result = WorkingTree.commit(self, message, revprops, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/decorators.py", line 217, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/mutabletree.py", line 210, in commit
    *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commit.py", line 289, in commit
    lossy=lossy)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 131, in run
    self.cleanups, self.func, self, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commit.py", line 436, in _commit
    message = message_callback(self)
  File "/usr/lib/python2.6/dist-packages/bzrlib/builtins.py", line 3273, in get_message
    start_message=start_message)
  File "/usr/lib/python2.6/dist-packages/bzrlib/msgeditor.py", line 149, in edit_commit_message_encoded
    if not _run_editor(msgfilename):
  File "/usr/lib/python2.6/dist-packages/bzrlib/msgeditor.py", line 62, in _run_editor
    for candidate, candidate_source in _get_editor():
  File "/usr/lib/python2.6/dist-packages/bzrlib/msgeditor.py", line 44, in _get_editor
    e = config.GlobalStack().get('editor')
  File "/usr/lib/python2.6/dist-packages/bzrlib/config.py", line 2675, in get
    for section in sections:
  File "/usr/lib/python2.6/dist-packages/bzrlib/config.py", line 2417, in get_sections
    self.load()
  File "/usr/lib/python2.6/dist-packages/bzrlib/config.py", line 2369, in load
    self._load_from_string(content)
  File "/usr/lib/python2.6/dist-packages/bzrlib/config.py", line 2384, in _load_from_string
    co_input = StringIO(str_or_unicode.encode('utf-8'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 52: ordinal not in range(128)

bzr 2.4b4 on python 2.6.7 (Linux-2.6.39-2-amd64-x86_64-with-debian-wheezy-sid)
arguments: ['/usr/bin/bzr', 'commit']
plugins: bash_completion[2.4b4], builddeb[2.7.0dev], bzrtools[2.4.0],
    changelog_merge[2.4b4], dbus[0.1.0dev], etckeeper[unknown],
    explorer[1.1.3], gtk[0.101.0dev], launchpad[2.4b4],
    netrc_credential_store[2.4b4], news_merge[2.4b4], qbzr[0.20.1],
    weave_fmt[2.4b4]
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_GB.UTF-8'

*** 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.

(Note that the name of the reporter was "Piotr Ożarowski", so he has non-utf8 characters in his configuration).

Tags: patch

Related branches

Revision history for this message
Jelmer Vernooij (jelmer) wrote :
Changed in bzr (Ubuntu):
status: New → Triaged
importance: Undecided → High
tags: added: patch
Vincent Ladeuil (vila)
Changed in bzr:
assignee: nobody → Vincent Ladeuil (vila)
Vincent Ladeuil (vila)
Changed in bzr:
milestone: none → 2.4b5
status: Confirmed → Fix Released
Revision history for this message
Vincent Ladeuil (vila) wrote :

A bit more explanations about this bug: it has been introduced in lp:bzr revno 5945. This was 2011-05-31 and there was no report about it until we released 2.4b4 on debian sid.

It impacts anybody with a bazaar.conf containing some non-ascii chars but only when no BZR_EDITOR environment variable is set.

So the workaround is to set BZR_EDITOR to a valid editor.

Changed in bzr (Debian):
status: Unknown → Fix Released
Jelmer Vernooij (jelmer)
Changed in bzr (Ubuntu):
status: Triaged → Fix Released
assignee: nobody → Jelmer Vernooij (jelmer)
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.