[BangPypers] ReadError: opening tar file

murugadoss murugadoss2884 at gmail.com
Fri Jun 4 07:57:37 CEST 2010


Hello,

I am trying to extract a tar file. while doing this i check the valid tar
file using is_tarfile( ).
It is working fine in a 32-bit linux machine with python 2.5.4 version and
when i try it out in a 64-bit linux pc, i end up saying file is
invalid(false). This machine was using python 2.4 and now i have upgraded to
2.5.4 version and I am using python 2.5.4.

I went through the library file, tarfile.py and found in is_tarfile(), is
opening the tarfile using tarfile.open.
>>>tar = /root/testtar.tar.gz
>>> import tarfile
>>> tarfile.is_tarfile(tar)
False
>>> tarfile.open(tar)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.5/tarfile.py", line 1153, in open
    raise ReadError("file could not be opened successfully")
tarfile.ReadError: file could not be opened successfully

Can anyone please help me

--
Thanks & Regards
V.Murugadoss


More information about the BangPypers mailing list