Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Re: CRC-checksum failed in gzip (http://www.velocityreviews.com/forums/t948916-re-crc-checksum-failed-in-gzip.html)

Laszlo Nagy 08-01-2012 10:47 AM

Re: CRC-checksum failed in gzip
 
On 2012-08-01 12:39, andrea crotti wrote:
> We're having some really obscure problems with gzip.
> There is a program running with python2.7 on a 2.6.18-128.el5xen (red
> hat I think) kernel.
>
> Now this program does the following:
> if filename == 'out2.txt':
> out2 = open('out2.txt')
> elif filename == 'out2.txt.gz'
> out2 = open('out2.txt.gz')

Gzip file is binary. You should open it in binary mode.

out2 = open('out2.txt.gz',"b")

Otherwise carriage return and newline characters will be converted (depending on the platform).




All times are GMT. The time now is 02:02 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.