ubuntu-support-status crashed with UnicodeEncodeError in __main__: ascii codec can t encode character xf6 in position 29: ordinal not in range 128

Bug #1556386 reported by sudodus on 2016-03-12
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)
Medium
Unassigned

Bug Description

In order to get output in English (not my local Swedish language) I ran the following alias in a terminal window

alias LC='LC_ALL=C;LANG=C'

and after that I ran

ubuntu-support-status --show-unsupported

$ LC
$ ubuntu-support-status --show-unsupported
Traceback (most recent call last):
  File "/usr/bin/ubuntu-support-status", line 145, in <module>
    print(_("Support status summary of '%s':") % os.uname()[1])
UnicodeEncodeError: 'ascii' codec can't encode character '\xf6' in position 29: ordinal not in range(128)

(I have used LC for years in several versions of Ubuntu without problems.)

The command

ubuntu-support-status --show-unsupported

works in my local language.

ProblemType: Crash
DistroRelease: Ubuntu 16.04
Package: update-manager-core 1:15.10.3
ProcVersionSignature: Ubuntu 4.4.0-11.26-generic 4.4.4
Uname: Linux 4.4.0-11-generic i686
NonfreeKernelModules: nvidia
ApportVersion: 2.20-0ubuntu3
Aptdaemon:

Architecture: i386
CurrentDesktop: LXDE
Date: Sat Mar 12 09:22:32 2016
ExecutablePath: /usr/bin/ubuntu-support-status
InstallationDate: Installed on 2016-02-28 (12 days ago)
InstallationMedia: Lubuntu 16.04 LTS "Xenial Xerus" - Alpha i386 (20160226)
InterpreterPath: /usr/bin/python3.5
PackageArchitecture: all
ProcCmdline: /usr/bin/python3 /usr/bin/ubuntu-support-status --show-unsupported
PythonArgs: ['/usr/bin/ubuntu-support-status', '--show-unsupported']
SourcePackage: update-manager
Title: ubuntu-support-status crashed with UnicodeEncodeError in __main__: 'ascii' codec can't encode character '\xf6' in position 29: ordinal not in range(128)
Traceback:
 Traceback (most recent call last):
   File "/usr/bin/ubuntu-support-status", line 145, in <module>
     print(_("Support status summary of '%s':") % os.uname()[1])
 UnicodeEncodeError: 'ascii' codec can't encode character '\xf6' in position 29: ordinal not in range(128)
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm audio cdrom dialout dip fax floppy libvirtd lpadmin netdev plugdev sambashare scanner sudo tape video

sudodus (nio-wiklund) wrote :
sudodus (nio-wiklund) wrote :

I bisected my LC alias:

LANG=C

provokes this bug.

LC_ALL=C

does not provoke it, but the output will still be in my native language.

tags: removed: need-duplicate-check
Changed in update-manager (Ubuntu):
importance: Undecided → Medium
information type: Private → Public
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/1556386

tags: added: iso-testing
Launchpad Janitor (janitor) wrote :

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

Changed in update-manager (Ubuntu):
status: New → Confirmed

Same for a German Ubuntu 16.04 LTS install and an installation pre-set to German, and it appears that the locale configuration is ignored - in the following situation, the output should be in English.

$ LC_MESSAGES=C ubuntu-support-status
Zusammenfassung der Unterstützung für 'somehost':

Sie haben 14 Pakete (0.2%), die bis Dezember 2021 (5y) unterstützt werden
Sie haben 1012 Pakete (14.9%), die bis Januar 2017 (9m) unterstützt werden
Sie haben 1098 Pakete (16.2%), die bis April 2019 (3y) unterstützt werden
Sie haben 2768 Pakete (40.8%), die bis April 2021 (5y) unterstützt werden

Sie haben 29 Pakete (0.4%), die nicht/nicht mehr heruntergeladen werden können
Sie haben 1857 nicht unterstützte Pakete (27.4%)

Für weitere Informationen mit --show-unsupported, --show-supported oder --show-all ausführen

Workaround: run:

env LC_ALL=C LANGUAGE= ubuntu-support-status

or

env LANGUAGE=en ubuntu-support-status

So it appears that the LANGUAGE=... variable takes precedence over LANG and LC_* although it's not a GUI application, and of course, ubuntu-support-status does not have a man page where this could be documented, and update-manager also does NOT document or reference this variable in an "ENVIRONMENT" section.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers