share.py crashed with UnicodeDecodeError in <module>()

Bug #444070 reported by Thibaut Robert
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Quickly
Fix Released
High
Didier Roche-Tolomelli
quickly (Ubuntu)
Fix Released
High
Didier Roche-Tolomelli

Bug Description

Binary package hint: quickly

I think there is a problem in the French translation of "%s %s is building on Launchpad. Wait for half an hour and have look at %s."

ProblemType: Crash
Architecture: amd64
Date: Mon Oct 5 23:51:53 2009
DistroRelease: Ubuntu 9.10
ExecutablePath: /usr/share/quickly/templates/ubuntu-project/share.py
InterpreterPath: /usr/bin/python2.6
NonfreeKernelModules: fglrx
Package: quickly-ubuntu-template 0.2.3
PackageArchitecture: all
ProcCmdline: /usr/bin/python /usr/share/quickly/templates/ubuntu-project/share.py
ProcEnviron:
 SHELL=/bin/bash
 LANG=fr_FR.UTF-8
 LANGUAGE=fr_FR.UTF-8
ProcVersionSignature: Ubuntu 2.6.31-11.38-generic
PythonArgs: ['/usr/share/quickly/templates/ubuntu-project/share.py']
SourcePackage: quickly
Title: share.py crashed with UnicodeDecodeError in <module>()
Traceback:
 Traceback (most recent call last):
   File "/usr/share/quickly/templates/ubuntu-project/share.py", line 130, in <module>
     print _("%s %s is building on Launchpad. Wait for half an hour and have look at %s.") % (project_name, version, ppa_url)
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 100: ordinal not in range(128)
Uname: Linux 2.6.31-11-generic x86_64
UserGroups: adm admin cdrom dialout disk libvirtd lpadmin plugdev sambashare video

Revision history for this message
Thibaut Robert (thibaut-robert) wrote :
tags: removed: need-duplicate-check
visibility: private → public
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Yes, it seems to be related to the French translation. I can reproduce it with it and I have no error with LC_ALL=C.

Investigating…

Changed in quickly (Ubuntu):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Ok, found it (found some free time to debug).

So, the answer is indeed in this line:
print _("%s %s is building on Launchpad. Wait for half an hour and have look at %s.") % (project_name, version, ppa_url)

ppa_url was in unicode (launchpad gives back this elements in unicode). print() can transtype unicode in str, but not gettext!

So, when you are using a translation which is localized, gettext try to encode ppa_url, which fails :)
The patch is simply:
print _("%s %s is building on Launchpad. Wait for half an hour and have look at %s.") % (project_name, version, ppa_url.encode('UTF-8'))

I am eager of having python3 pushed by default :)
Fixed in trunk, and a new release this fix will be present before karmic one.

Changed in quickly (Ubuntu):
assignee: nobody → Didier Roche (didrocks)
Changed in quickly:
assignee: nobody → Didier Roche (didrocks)
importance: Undecided → High
status: New → Fix Committed
Changed in quickly:
milestone: none → 0.2.4
Changed in quickly:
status: Fix Committed → Fix Released
Changed in quickly (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package quickly - 0.2.4

---------------
quickly (0.2.4) karmic; urgency=low

  * New release:
   + Quickly Core:
     - add comment regarding why certain characters are not allowed
       and remove any whitespace around project name (Mike Pontillo)
     - Fixed a bad project name variable in a function comment and a typo in
       the tutorial (Sense Hofstede)
     - Enable quickly running without an existing data path (LP: #447089)
     - Some refactoring on error handling with incorrect template path
   + ubuntu-project Template:
     - Fix share unicode issue when localized (LP: #444070)
     - quickly dialog needs input validation (LP: #442446)
     - Fix wrong link in tutorial (LP: #446310) (Johannes Mockenhaupt)
     - Added <p></p> paragraph where missing, adjust link to no point directly
       to rick's personal folder, removed stray, 'd' and 'su' on the second
       page of the dialog, changed couchgrid initialization should follow
       new way of doing it, change copyright file in tutorial to us '(C)',
       change packaging tutorial from svg to png (LP: #439111)
     - Focus is on the main window file when executing quickly glad (fix
       regression when project name has some capital letters)
   + common:
     - update translations

 -- Didier Roche <email address hidden> Mon, 12 Oct 2009 19:48:17 +0200

Changed in quickly (Ubuntu):
status: Fix Committed → 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.