gzip.py failure

John Weeks jhweeks at earthlink.net
Sat Jun 16 12:38:57 EDT 2001


I'm running Python 2.0 from the SuSE 7.1 distribution.

I'm getting an attribute error when trying to umcompress a gziped file. The 
error occurs on line 210 of the gzip.py module:

      if self.decompress.unused_data != "":

There doesn't seem to be an "unused_data" attribute for the "decompress" 
object.

Running this program:

   from gzip import *
   def gf():
        f=GzipFile("g.data","r")
        c=f.read()
        print c

   gf()

produces the following:

 Traceback (most recent call last):
  File "tt.py", line 7, in ?
    gf()
  File "tt.py", line 4, in gf
    c=f.read()
  File "/usr/lib/python2.0/gzip.py", line 149, in read
    self._read(readsize)
  File "/usr/lib/python2.0/gzip.py", line 210, in _read
    if self.decompress.unused_data != "":
  AttributeError: unused_data

Anybody have any ideas?

Thanks,
JW
jhweeks at earthlink.net




More information about the Python-list mailing list