[New-bugs-announce] [issue6584] gzip module has no custom exception

Sridhar Ratnakumar report at bugs.python.org
Mon Jul 27 08:10:50 CEST 2009

New submission from Sridhar Ratnakumar <sridharr at activestate.com>:

Much like zipfile.BadZipfile, we need a base custom exception for the 
gzip module. At least, catch gzip-related exceptions and throw a 
tarfile.TarError when used *via* tarfile.*.

See the following example (the exception escaped the "try... except 
tarfile.TarError: .. " block!):

  File "/home/sridharr/as/pypm/src/pypm/common/compression.py", line 
199, in _ensure_read_write_access
    for tarinfo in tarfileobj.getmembers():
  File "/opt/ActivePython-2.6/lib/python2.6/tarfile.py", line 1791, in 
    self._load()        # all members, we first have to
  File "/opt/ActivePython-2.6/lib/python2.6/tarfile.py", line 2352, in 
    tarinfo = self.next()
  File "/opt/ActivePython-2.6/lib/python2.6/tarfile.py", line 2307, in 
  File "/opt/ActivePython-2.6/lib/python2.6/gzip.py", line 382, in seek
  File "/opt/ActivePython-2.6/lib/python2.6/gzip.py", line 219, in read
  File "/opt/ActivePython-2.6/lib/python2.6/gzip.py", line 284, in _read
  File "/opt/ActivePython-2.6/lib/python2.6/gzip.py", line 304, in 
IOError: CRC check failed 0x115929f0 != 0x9f074a38L

components: Library (Lib)
messages: 90976
nosy: srid
severity: normal
status: open
title: gzip module has no custom exception
type: behavior
versions: Python 2.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list