Hi Alan

A bunch of gzipped files are read with the majority working but a few don't.  I 
don't know if these files were originally zipped with gzip but I'd guess that 
they were.

Strangely, for the files that don't work I can read/print the file almost to 
the end and then it falls over with the CRC error.

Dinesh



--------------------------------------------------------------------------------

Message: 5
Date: Mon, 1 Dec 2008 00:57:04 -0000
From: "Alan Gauld" <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Reading gzip files
To: [email protected]
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
reply-type=original


"Dinesh B Vadhia" <[EMAIL PROTECTED]> wrote

> I'm reading gzip files and writing the content out to a text file 
> line by line.
>  File "C:\Python25\lib\gzip.py", line 275, in _read
>    self._read_eof()
>  File "C:\Python25\lib\gzip.py", line 311, in _read_eof
>    raise IOError, "CRC check failed"
> IOError: CRC check failed
>
> I've checked the Python docs and online but cannot find a
> solution to the problem.  Thanks.

At great risk of stating the obvious but have you actually checked
that the CRC of the gzipped file is correct? Does the problem only
happen with this file or with all gzipped files?

And are the files actually zipped by gzip or by some other
"compatible" program? If other does it work for genuine
gzipped files?

Just some ideas to play with.

Alan G 
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to