update-manager crashed with UnicodeDecodeError in print_help()

Bug #557804 reported by ukondo
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Translations
Fix Released
High
Ubuntu Japanese Translators
python2.6 (Ubuntu)
Invalid
Undecided
Unassigned
update-manager (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: update-manager

crashed when `update-manager --help`
no crash when `LANG= update-manager --help`
LANG=ja_JP.utf8

ProblemType: Crash
DistroRelease: Ubuntu 10.04
Package: update-manager 1:0.133.11
ProcVersionSignature: Ubuntu 2.6.32-19.28-generic 2.6.32.10+drm33.1
Uname: Linux 2.6.32-19-generic x86_64
Architecture: amd64
Date: Thu Apr 8 12:55:05 2010
ExecutablePath: /usr/bin/update-manager
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Beta amd64 (20100318)
InterpreterPath: /usr/bin/python2.6
PackageArchitecture: all
ProcCmdline: /usr/bin/python2.6 /usr/bin/update-manager --help
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, no user)
 LANG=ja_JP.utf8
PythonArgs: ['/usr/bin/update-manager', '--help']
SourcePackage: update-manager
Title: update-manager crashed with UnicodeDecodeError in print_help()
UserGroups: adm admin cdrom dialout lpadmin plugdev sambashare

Revision history for this message
ukondo (udzura) wrote :
tags: removed: need-duplicate-check
visibility: private → public
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report. Confirmed with update-manager 0.134

Changed in update-manager (Ubuntu):
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

The following string seems to not be recognized as valid utf-8 in po/ja.po
#: ../update-manager:62
msgid "Check if a new Ubuntu release is available"
msgstr "新しい Ubuntu のリリースが利用可能かどうかチェックする"

This one seems to be invalid utf8
#: ../update-manager:83 ../do-release-upgrade:52
msgid "Test upgrade with a sandbox aufs overlay"
msgstr "aufsオーバレイを実験環境に用いてのテストアップグレード"

I'm adding a translation task for verification.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

The problem is located at the <?><?> :
新しい Ubuntu のリリースが利用可能かど��かチェックする

David Planella (dpm)
Changed in ubuntu-translations:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Ubuntu Japanese Translators (ubuntu-l10n-ja)
Revision history for this message
David Planella (dpm) wrote :
Revision history for this message
Michael Vogt (mvo) wrote :

This is odd, in my source tree I see:
$ isutf8 po/ja.po
$ echo $?
0

So it appears to have nothing to complain. Maybe a langpack export problem?

Revision history for this message
Fumihito YOSHIDA (hito) wrote :

Hi, I check with po files with some testing, It seems pythons's optparse (parser.parse_args()) bug.
(@mvo: It like DDTP auto-fill bugs)

optparse are auto-fill(pretty) at some length, but this is not understood UTF-8(why?).
So it brake help strings.

For workaround, I have commit these alternate translation that included '\n' strings
for by-the-hand pretty;)

https://translations.launchpad.net/ubuntu/lucid/+source/update-manager/+pots/update-manager/ja/+translate?batch=10&show=all&search=Check+if+a+new+Ubuntu+release+is+available
https://translations.launchpad.net/ubuntu/lucid/+source/update-manager/+pots/update-manager/ja/+translate?batch=10&show=all&search=Test+upgrade+with+a+sandbox+aufs+overlay

This is my test environment, we can use update-manager -help
$ update-manager -help
Usage: update-manager [options]

Options:
  -h, --help show this help message and exit
  -V, --version バージョンを表示して終了
  --data-dir=DATA_DIR データファイルの含まれるディレクトリ
  -c, --check-dist-upgrades
                        新しい Ubuntu のリリースが <- this is '\n'
                        利用可能かどうかチェックする
  -d, --devel-release 最新の開発リリースへのアップデートが
                        利用可能かどうかチェックする
  -p, --proposed リリースアップグレードが提案する最新
                        のバージョンを使ってアップグレードを
                        行う
  --no-focus-on-map 起動時にウィンドウに入力フォーカスを
                        当てない
  --dist-upgrade dist-upgradeを実行する
  -s, --sandbox aufsオーバレイを実験環境に <- this is '\n'
                        用いてのテストアップグレード

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for this update! it is indeed the same problem. It looks like optparse.py uses:

        return textwrap.fill(text,
                             text_width,
                             initial_indent=indent,
                             subsequent_indent=indent)

For ja.po this will be a utf8 encoded python str type. But textwrap needs a "unicode" type to wrap it correctly.

Michael Vogt (mvo)
affects: python-defaults (Ubuntu) → python2.6 (Ubuntu)
Revision history for this message
Michael Vogt (mvo) wrote :

It looks like the alternative is to use "ugettext" that returns a unicode type instead of a string type. I will try that next.

Michael Vogt (mvo)
Changed in python2.6 (Ubuntu):
status: New → Invalid
Changed in update-manager (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-manager - 1:0.134.4

---------------
update-manager (1:0.134.4) lucid; urgency=low

  * DistUpgrade/DistUpgrade.cfg, DistUpgrade/DistUpgrade.cfg.hardy:
    - do not enable apport anymore
  * DistUpgrade/DistUpgradeViewGtk.py:
    - set empty dialog titles for error/information dialogs (it looks
      like glade removed those for some reason from the .ui file)
  * DistUpgrade/DistUpgradeAufs.py:
    - fix crash if aufs (--sandbox mode) is used (LP: #562394)
  * DistUpgrade/DistUpgradeMain.py:
    - fix generation of system state file for non-existing dirs/files
      (LP: #561872)
  * UpdateManager/UpdateManager.py:
    - provide a LIST_TOGGLE_CHECKED column as a workaround for orca
      that does not work with values updated via
      column_install.set_cell_data_func (LP: #561563)
  * update-manager:
    - use gettext.install(unicode=True) to avoid breaking with
      optparse and ja.po (LP: #557804)
 -- Michael Vogt <email address hidden> Wed, 14 Apr 2010 17:54:47 +0200

Changed in update-manager (Ubuntu):
status: Fix Committed → Fix Released
David Planella (dpm)
Changed in ubuntu-translations:
status: Triaged → Fix Released
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.