IOError: Not a gzipped file on uncompressed gzip attachment

Bug #574360 reported by Jean-Baptiste Lallement
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)
Fix Released
Low
Martin Pitt

Bug Description

Binary package hint: apport

When you download a report with an attachment with a .gz extension but this attachment is already decompressed, the download of the report fails with the error:

Traceback (most recent call last):
  File "./crashdb_bug.py", line 6, in <module>
    report = crashdb.download(573714)
  File "/usr/lib/python2.6/dist-packages/apport/crashdb_impl/launchpad.py", line 291, in download
    report[key] = gzip.GzipFile(fileobj=attachment).read()#TODO: is this the best solution?
  File "/usr/lib/python2.6/gzip.py", line 212, in read
    self._read(readsize)
  File "/usr/lib/python2.6/gzip.py", line 255, in _read
    self._read_gzip_header()
  File "/usr/lib/python2.6/gzip.py", line 156, in _read_gzip_header
    raise IOError, 'Not a gzipped file'
IOError: Not a gzipped file

== Example to reproduce ==
#!/usr/bin/python
import apport
from apport.crashdb import get_crashdb

crashdb = get_crashdb(None)
report = crashdb.download(573714)

This is a very common failure with reports with VarLogDistupgradeLspcitxt.gz attached.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: apport 1.13.3-0ubuntu2
ProcVersionSignature: Ubuntu 2.6.32-19.28-generic 2.6.32.10+drm33.1
Uname: Linux 2.6.32-19-generic i686
ApportLog:

Architecture: i386
CrashReports: 600:0:0:804682:2010-04-27 00:27:41.000000000 +0200:2010-04-27 10:30:31.000000000 +0200:/var/crash/lemonpos.0.crash
Date: Mon May 3 12:28:17 2010
EcryptfsInUse: Yes
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.utf8
 SHELL=/bin/bash
SourcePackage: apport

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

Here is a possible patch.

tags: added: patch
Martin Pitt (pitti)
Changed in apport (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
importance: Undecided → Low
status: New → In Progress
Revision history for this message
Martin Pitt (pitti) wrote :

Fixed in trunk r1775

Changed in apport (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apport - 1.14-0ubuntu1

---------------
apport (1.14-0ubuntu1) maverick; urgency=low

  * New upstream release:
    - hookutils.py: Add new method attach_drm_info() to read and format
      /sys/class/drm/*. (desktop-maverick-xorg-gpu-freeze-reports)
    - packaging-apt-dpkg.py: Fix deprecated python-apt variables, thanks David
      Stansby. (LP: #591695)
    - launchpad.py: Fix crash on attachments which are named *.gz, but
      uncompressed. (LP: #574360)
    - hookutils.py, attach_gconf(): Fix defaults parsing for boolean keys.
      (LP: #583109)
  * debian/control: Bump p-distutils-extra build-dependency to 2.19, to ensure
    that we get a complete translation template. (LP: #533565)
 -- Martin Pitt <email address hidden> Wed, 16 Jun 2010 15:50:55 +0200

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