alacarte crashed with UnicodeEncodeError in save(): 'ascii' codec can't encode characters in position 307-315: ordinal not in range(128)

Bug #1057600 reported by Dmitry Shachnev
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Alacarte Menu Editor
Fix Released
Undecided
Unassigned
alacarte (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Alacarte crashed on quantal, and killed gnome-panel also. A traceback is attached.

Something like this should fix the problem:

--- a/Alacarte/MenuEditor.py 2012-08-27 07:08:52.000000000 +0400
+++ b/Alacarte/MenuEditor.py 2012-09-27 20:09:41.526015518 +0400
@@ -49,7 +49,7 @@

     def save(self):
         fd = open(self.path, 'w')
- fd.write(self.dom.toprettyxml())
+ fd.write(self.dom.toprettyxml().encode('utf-8'))
         fd.close()

     def restoreToSystem(self):

ProblemType: Crash
DistroRelease: Ubuntu 12.10
Package: alacarte 3.5.5-0ubuntu1
ProcVersionSignature: Ubuntu 3.5.0-15.23-generic 3.5.4
Uname: Linux 3.5.0-15-generic i686
ApportVersion: 2.5.2-0ubuntu4
Architecture: i386
Date: Thu Sep 27 19:45:49 2012
ExecutablePath: /usr/bin/alacarte
InstallationMedia: Ubuntu 10.04 "Lucid Lynx" - Beta i386 (20100318)
InterpreterPath: /usr/bin/python2.7
PackageArchitecture: all
ProcCmdline: /usr/bin/python -OOt /usr/bin/alacarte
PythonArgs: ['/usr/bin/alacarte']
SourcePackage: alacarte
Title: alacarte crashed with UnicodeEncodeError in save(): 'ascii' codec can't encode characters in position 307-315: ordinal not in range(128)
UpgradeStatus: Upgraded to quantal on 2012-09-23 (4 days ago)
UserGroups: adm admin audio cdrom dialout dip fax floppy fuse lpadmin netdev nopasswdlogin plugdev sambashare tape video

Revision history for this message
Dmitry Shachnev (mitya57) wrote :
visibility: private → public
tags: removed: need-duplicate-check
Changed in alacarte (Ubuntu):
importance: Undecided → Medium
description: updated
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in alacarte (Ubuntu):
status: New → Confirmed
Revision history for this message
Jasper St. Pierre (jstpierre) wrote :

Pushed a more comprehensive fix to git master. Thanks! Not sure what flags I'm supposed to set in Launchpad.

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Thank you! There was another crash caused by this one (for me) — bug 1057603, I guess it can now be marked as Fix Committed too?

Changed in alacarte:
status: New → Fix Committed
Changed in alacarte (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Dmitry Shachnev (mitya57) wrote :

Fixed in ≥ 3.7.90.

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