Apport hook breaks with Pyhton2 due to non-ASCII character

Bug #919956 reported by Thomas Schweikle
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
Medium
Brian Murray

Bug Description

$ ubuntu-bug grub2

*** Collecting problem information

The collected information can be sent to the developers to improve the
application. This might take a few minutes.
..ERROR: hook /usr/share/apport/package-hooks//source_grub2.py crashed:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/apport/report.py", line 692, in add_hooks_info
    execfile(hook, symb)
  File "/usr/share/apport/package-hooks//source_grub2.py", line 30
SyntaxError: Non-ASCII character '\xe2' in file /usr/share/apport/package-hooks//source_grub2.py on line 30, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
.

*** Send problem report to the developers?

After the problem report has been sent, please fill out the form in the
automatically opened web browser.

What would you like to do? Your options are:
  S: Send report (0.3 KB)
  V: View report
  K: Keep report file for sending later or copying to somewhere else
  C: Cancel
Please choose (S/V/K/C):

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: apport 1.23-0ubuntu4
ProcVersionSignature: Ubuntu 3.0.0-14.23-server 3.0.9
Uname: Linux 3.0.0-14-server x86_64
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
Date: Sun Jan 22 11:58:41 2012
InstallationMedia: Ubuntu-Server 10.10 "Maverick Meerkat" - Release amd64 (20101007)
PackageArchitecture: all
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, user)
 LANG=de_DE.UTF-8
SourcePackage: apport
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Thomas Schweikle (tps) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

       # GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash nomodeset”

It's the fancy quotes which are not ASCII, and make Python 2 trip. As most of Apport uses Python 3 these days, it's not a biggie, but apport-collect is still python2 (due to missing python3-launchpadlib), so we should fix this.

affects: apport (Ubuntu) → grub2 (Ubuntu)
Changed in grub2 (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
summary: - apport doesn't function for various pacakges -- breaking with python
- errors
+ Apport hook breaks with Pyhton2 due to non-ASCII character
Revision history for this message
Martin Pitt (pitti) wrote :

Reproducer:

$ python2 /usr/share/apport/package-hooks//source_grub2.py
  File "/usr/share/apport/package-hooks//source_grub2.py", line 33
SyntaxError: Non-ASCII character '\xe2' in file /usr/share/apport/package-hooks//source_grub2.py on line 33, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

Revision history for this message
Martin Pitt (pitti) wrote :

Turns out it's already fixed in the packaging bzr, I committed the bug ref to the changelog. Brian, can this be uploaded soon?

Changed in grub2 (Ubuntu):
assignee: nobody → Brian Murray (brian-murray)
status: Triaged → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

Its in the queue now, thanks for the reminder.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 1.99-22ubuntu2

---------------
grub2 (1.99-22ubuntu2) quantal; urgency=low

  [ Brian Murray ]
  * source_grub2.py: use attach_default_grub from apport's hookutils
    This also fixes the missing encoding statement if the file contains
    non-ASCII characters. (LP: #919956)
 -- Brian Murray <email address hidden> Tue, 04 Sep 2012 08:59:05 -0700

Changed in grub2 (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.