Message90976
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
getmembers
self._load() # all members, we first have to
File "/opt/ActivePython-2.6/lib/python2.6/tarfile.py", line 2352, in
_load
tarinfo = self.next()
File "/opt/ActivePython-2.6/lib/python2.6/tarfile.py", line 2307, in
next
self.fileobj.seek(self.offset)
File "/opt/ActivePython-2.6/lib/python2.6/gzip.py", line 382, in seek
self.read(1024)
File "/opt/ActivePython-2.6/lib/python2.6/gzip.py", line 219, in read
self._read(readsize)
File "/opt/ActivePython-2.6/lib/python2.6/gzip.py", line 284, in _read
self._read_eof()
File "/opt/ActivePython-2.6/lib/python2.6/gzip.py", line 304, in
_read_eof
hex(self.crc)))
IOError: CRC check failed 0x115929f0 != 0x9f074a38L |
|
Date |
User |
Action |
Args |
2009-07-27 06:10:50 | srid | set | recipients:
+ srid |
2009-07-27 06:10:50 | srid | set | messageid: <1248675050.27.0.747048824781.issue6584@psf.upfronthosting.co.za> |
2009-07-27 06:10:48 | srid | link | issue6584 messages |
2009-07-27 06:10:47 | srid | create | |
|