[BangPypers] ReadError: opening tar file
Anand Balachandran Pillai
abpillai at gmail.com
Fri Jun 4 12:55:36 CEST 2010
On Fri, Jun 4, 2010 at 4:15 PM, murugadoss <murugadoss2884 at gmail.com> wrote:
> Thank for the reply.
> The tar file is not corrupted, i am using the same file in 32-bit m/c and
> able to extract it. I have attached this output also with the mail.
> I am getting this problem only in 64-bit m/c.
>
And what is this whole exercise aimed at ? Why are you
trying to open a tar file using Python first in a 32-bit and then
on a 64-bit machine ? Can we have some background ? Otherwise
this looks like a pretty weird exercise to me.
Tar files are platform agnostic. Otherwise, you would
have a nightmare opening tar files downloaded from the internet.
A tar file created in 32 bit Linux should open in 64 bit Linux
and vice-verza.
Most probably the file got corrupted when you copied (or
downloaded ?) it to the 32 bit machine. Try this on ur
machines - they should print the same value.
>>> import binascii
>>> data = open(tar, 'rb').read()
>>> binascii.crc32(data)
Also, try an md5 checksum.
>>> import hashlib
>>> m=hashlib.md5()
>>> m.update(data)
>>> m.hexdigest()
'5b603d8b5dbf6004d802efc4dedac68c'
>
>
--
--Anand
More information about the BangPypers
mailing list