[Tutor] Reading gzip files

Alan Gauld alan.gauld at btinternet.com
Mon Dec 1 01:57:04 CET 2008

"Dinesh B Vadhia" <dineshbvadhia at hotmail.com> 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 

More information about the Tutor mailing list