UnicodeEncodeError from `bzr help` when localisation is enabled

Bug #930919 reported by Dmitry Shachnev
40
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Martin Packman
2.5
Fix Released
High
Martin Packman
bzr (Ubuntu)
Fix Released
High
Jelmer Vernooij
Precise
Fix Released
High
Jelmer Vernooij

Bug Description

Bzr crashed when I ran "bzr help push".

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 919, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 1124, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 672, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 694, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 1141, in ignore_pipe
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/builtins.py", line 4725, in run
    bzrlib.help.help(topic)
  File "/usr/lib/python2.7/dist-packages/bzrlib/help.py", line 53, in help
    outfile.write(source.get_help_text(shadowed_terms))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-9: ordinal not in range(128)

ProblemType: Crash
DistroRelease: Ubuntu 12.04
Package: bzr 2.5.0~beta5-3ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-15.24-generic 3.2.5
Uname: Linux 3.2.0-15-generic i686
ApportVersion: 1.91-0ubuntu1
Architecture: i386
BzrDebugFlags: set()
BzrVersion: 2.5b5
CommandLine: ['/usr/bin/bzr', 'help', 'push']
CrashDb: bzr
Date: Sun Feb 12 14:40:47 2012
ExecutablePath: /usr/bin/bzr
FileSystemEncoding: UTF-8
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Beta i386 (20100318)
InterpreterPath: /usr/bin/python2.7
Locale: ru_RU.UTF-8
PackageArchitecture: all
Platform: Linux-3.2.0-15-generic-i686-with-Ubuntu-12.04-precise
ProcCmdline: /usr/bin/python /usr/bin/bzr help push
PythonVersion: 2.7.2
SourcePackage: bzr
Title: bzr crashed with UnicodeEncodeError in help(): 'ascii' codec can't encode characters in position 0-9: ordinal not in range(128)
UpgradeStatus: Upgraded to precise on 2012-02-10 (1 days ago)
UserEncoding: utf-8
UserGroups: adm admin audio cdrom dialout dip fax floppy fuse lpadmin netdev nopasswdlogin plugdev sambashare tape video

Related branches

Revision history for this message
Dmitry Shachnev (mitya57) wrote :
visibility: private → public
description: updated
tags: removed: need-duplicate-check
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in bzr (Ubuntu):
status: New → Confirmed
Martin Packman (gz)
Changed in bzr:
importance: Undecided → High
status: New → Confirmed
tags: added: encoding i18n
summary: - bzr crashed with UnicodeEncodeError in help(): 'ascii' codec can't
- encode characters in position 0-9: ordinal not in range(128)
+ UnicodeEncodeError from `bzr help` when localisation is enabled
Changed in bzr:
milestone: none → 2.5.1
Revision history for this message
Martin Packman (gz) wrote :

I only trigger this when piping the output or similar so the stdout stream has no encoding specified, are there other ways too?

Changed in bzr:
assignee: nobody → Martin Packman (gz)
status: Confirmed → In Progress
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

No, for me it crashes only when I pipe it (for example, to less).

Revision history for this message
IWATA Hidetaka (hid-iwata) wrote :

AFAICS::
   Windows 7 + Python 2.7.2 => `bzr help` works.
   Windows 7 + Python 2.6.6 => `bzr help` crashes even when no pipe specified.

Revision history for this message
Daniel Cordeiro (dcordeiro) wrote :

I can reproduce it if I run, for example:
$ LC_ALL=C bzr help update

Martin Packman (gz)
Changed in bzr:
milestone: 2.5.1 → 2.6b1
Martin Packman (gz)
Changed in bzr:
status: In Progress → Fix Released
Jelmer Vernooij (jelmer)
Changed in bzr (Ubuntu):
status: Confirmed → Fix Released
importance: Undecided → High
assignee: nobody → Jelmer Vernooij (jelmer)
Changed in bzr (Ubuntu Precise):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Jelmer Vernooij (jelmer)
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Quantal still has 2.5.0, so changing the status back until 2.5.1 is uploaded.

Changed in bzr (Ubuntu):
status: Fix Released → Fix Committed
Jelmer Vernooij (jelmer)
Changed in bzr (Ubuntu):
status: Fix Committed → Fix Released
Changed in bzr (Ubuntu Precise):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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