Apport hook breaks with Pyhton2 due to non-ASCII character

Bug #919956 reported by Thomas Schweikle on 2012-01-22
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
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)

Thomas Schweikle (tps) wrote :
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
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

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
Brian Murray (brian-murray) wrote :

Its in the queue now, thanks for the reminder.

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  Edit
Everyone can see this information.

Other bug subscribers