UnicodeDecodeError in localeconv(): 'locale' codec can't decode byte in position 0

Bug #1351574 reported by schamane
This bug affects 1 person
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)

Bug Description

update-manager crashes reproducibly when it is about to show the list of packages to be updated, apparently when it tries to calculate the amount of data to be downloaded. It fires up, loads updates and then crashes or shows an empty window.

The crash should be reproducible by others by setting e.g. LC_MONETARY=de_AT.iso885915@euro or its alias de_AT@euro where all other locales are UTF-8 (see my detailed environment). When testing make sure that the locale is available, otherwise it will fall back to 'C' and update-manager will not crash.

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/UpdateManager/UpdatesAvailable.py", line 1018, in set_update_list
    self._add_header(_("Security updates"), self.list.security_groups)
  File "/usr/lib/python3/dist-packages/UpdateManager/UpdatesAvailable.py", line 964, in _add_header
  File "/usr/lib/python3/dist-packages/UpdateManager/Core/utils.py", line 489, in humanize_size
    return locale.format_string(_("%.1f MB"), bytes / 1000.0 / 1000.0)
  File "/usr/lib/python3.4/locale.py", line 249, in format_string
  File "/usr/lib/python3.4/locale.py", line 208, in _format
    decimal_point = localeconv()[monetary and 'mon_decimal_point'
  File "/usr/lib/python3.4/locale.py", line 111, in localeconv
    d = _localeconv()
UnicodeDecodeError: 'locale' codec can't decode byte 0xa4 in position 0: Invalid or incomplete multibyte or wide character

As also the traceback suggests this might even be a security issue if it keeps people from updating their systems.

Of course, a simple fix/workaround is to avoid the troublesome locale by setting it to e.g. de_AT.UTF-8 or C. Still, I think that update-manager should not crash.

Note the similarities of an older bug report: https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/1131958

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: update-manager 1:0.196.12
ProcVersionSignature: Ubuntu 3.13.0-32.57-generic
Uname: Linux 3.13.0-32-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.2
Architecture: amd64
CurrentDesktop: LXDE
Date: Sat Aug 2 11:03:55 2014


 b'com.ubuntu.update-manager' b'show-details' b'true'
 b'com.ubuntu.update-manager' b'window-height' b'345'
 b'com.ubuntu.update-manager' b'first-run' b'false'
 b'com.ubuntu.update-manager' b'window-width' b'485'
 b'com.ubuntu.update-manager' b'launch-time' b'1406968074'
InstallationDate: Installed on 2014-05-12 (81 days ago)
InstallationMedia: Lubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140416.2)
PackageArchitecture: all
SourcePackage: update-manager
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
schamane (schamane) wrote :
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.