Re: CRC-checksum failed in gzip

Discussion in 'Python' started by Laszlo Nagy, Aug 1, 2012.

  1. Laszlo Nagy

    Laszlo Nagy Guest

    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).
     
    Laszlo Nagy, Aug 1, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. andrea crotti

    CRC-checksum failed in gzip

    andrea crotti, Aug 1, 2012, in forum: Python
    Replies:
    0
    Views:
    165
    andrea crotti
    Aug 1, 2012
  2. andrea crotti

    Re: CRC-checksum failed in gzip

    andrea crotti, Aug 1, 2012, in forum: Python
    Replies:
    0
    Views:
    164
    andrea crotti
    Aug 1, 2012
  3. Laszlo Nagy

    Re: CRC-checksum failed in gzip

    Laszlo Nagy, Aug 1, 2012, in forum: Python
    Replies:
    0
    Views:
    197
    Laszlo Nagy
    Aug 1, 2012
  4. andrea crotti

    Re: CRC-checksum failed in gzip

    andrea crotti, Aug 1, 2012, in forum: Python
    Replies:
    11
    Views:
    469
    andrea crotti
    Aug 2, 2012
  5. Laszlo Nagy

    Re: CRC-checksum failed in gzip

    Laszlo Nagy, Aug 1, 2012, in forum: Python
    Replies:
    0
    Views:
    222
    Laszlo Nagy
    Aug 1, 2012
Loading...

Share This Page