do-release-upgrade crashed with UnicodeDecodeError in __main__: 'ascii' codec can't decode byte 0xc3 in position 36: ordinal not in range(128)

Bug #929399 reported by Daniel Holbach on 2012-02-09
This bug affects 18 people
Affects Status Importance Assigned to Milestone
ubuntu-release-upgrader (Ubuntu)

Bug Description

I triggered the crash by running:

  LC_ALL=C do-release-upgrade --help

ProblemType: Crash
DistroRelease: Ubuntu 12.04
Package: update-manager-core 1:0.156.4
ProcVersionSignature: Ubuntu 3.2.0-14.23-generic 3.2.3
Uname: Linux 3.2.0-14-generic x86_64
ApportVersion: 1.91-0ubuntu1
Architecture: amd64
CheckboxSubmission: 2f383a1679e8525d7196eb2518a1921f
CheckboxSystem: bb422ca46d02494cdbc459927a98bc2f
Date: Thu Feb 9 09:58:58 2012
ExecutablePath: /usr/bin/do-release-upgrade
 com.ubuntu.update-manager first-run false
 com.ubuntu.update-manager launch-time 1327602597
 com.ubuntu.update-manager window-height 600
 com.ubuntu.update-manager window-width 600
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Alpha amd64 (20110817)
InterpreterPath: /usr/bin/python2.7
ProcCmdline: /usr/bin/python /usr/bin/do-release-upgrade --help
PythonArgs: ['/usr/bin/do-release-upgrade', '--help']
SourcePackage: update-manager
Title: do-release-upgrade crashed with UnicodeDecodeError in __main__: 'ascii' codec can't decode byte 0xc3 in position 36: ordinal not in range(128)
 Traceback (most recent call last):
   File "/usr/bin/do-release-upgrade", line 46, in <module>
     help=_("Show version and exit").decode(enc))
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 36: ordinal not in range(128)
UpgradeStatus: Upgraded to precise on 2012-01-12 (27 days ago)
UserGroups: adm admin audio cdrom dialout lpadmin plugdev sambashare

Daniel Holbach (dholbach) wrote :
tags: removed: need-duplicate-check
visibility: private → public
Changed in update-manager (Ubuntu):
importance: Undecided → Medium
RedSingularity (redsingularity) wrote :

Were you just running this command in a terminal while an upgrade was in progress in order to produce the crash?
Ubuntu Bug Squad volunteer triager

Daniel Holbach (dholbach) wrote :

No - no upgrade in the background. This is still reproducible. Did you try running the command?

RedSingularity (redsingularity) wrote :

Yes I ran the command without an issue. I was just wondering if you had run it while there was an update in progress with the update-manager. If thats the case I will try running the command again while an update is going.
Ubuntu Bug Squad volunteer triager

Daniel Holbach (dholbach) wrote :

No, there was no update in progress. I use a German locale normally - I don't know if that has anything to do with it. Did you try it on Ubuntu 12.04?

Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report Daniel.

This is reproducible by installing a German locale then running:
LANGUAGE=de:en LC_ALL=C do-release-upgrade --help

(which is how the system is set according to proc/environ)

Changed in update-manager (Ubuntu):
status: New → Triaged
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Steve Langasek (vorlon) wrote :

I'm not sure this is actually a bug to be fixed. LC_ALL=C means that LC_CTYPE is also set to C; that's a declaration that you only want ascii output, but the language setting asks the application to use the German translation if available - which it obviously is, and evidently contains non-ascii characters.

So while we could fix the code to avoid a backtrace, none of the available options seem more correct. Outputting the text in UTF-8 means ignoring the locale setting; dropping the non-ascii characters means a garbled translation.

Daniel, is this really an issue specific to do-release-upgrade? Does other command-line software generally get translated correctly for you with these settings?

Steve Langasek (vorlon) wrote :

Note that you can set LC_ALL=C.UTF-8 to get the relevant C locale semantics but with a UTF-8 charset.

Changed in update-manager (Ubuntu):
assignee: Canonical Foundations Team (canonical-foundations) → nobody
Brian Murray (brian-murray) wrote :

I believe I fixed in the process of fixing some other translation issues. Could you please test this again in Quantal? Thanks in advance.

Changed in update-manager (Ubuntu):
status: Triaged → Incomplete
Daniel Holbach (dholbach) wrote :

Still a problem:

daniel@daydream:~$ LC_ALL=C do-release-upgrade --help
Traceback (most recent call last):
  File "/usr/bin/do-release-upgrade", line 100, in <module>
    (options, args) = parser.parse_args()
  File "/usr/lib/python3.2/", line 1388, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python3.2/", line 1428, in _process_args
    self._process_long_opt(rargs, values)
  File "/usr/lib/python3.2/", line 1503, in _process_long_opt
    option.process(opt, value, values, self)
  File "/usr/lib/python3.2/", line 786, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib/python3.2/", line 808, in take_action
  File "/usr/lib/python3.2/", line 1650, in print_help
UnicodeEncodeError: 'ascii' codec can't encode character '\xdf' in position 162: ordinal not in range(128)

Changed in update-manager (Ubuntu):
status: Incomplete → Triaged
Robert Roth (evfool) wrote :

Reassigning to the ubuntu-release-upgrader package as it has been split out from update-manager in the Quantal cycle.

affects: update-manager (Ubuntu) → ubuntu-release-upgrader (Ubuntu)
tags: added: raring
tags: removed: raring
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers