[BangPypers] ReadError: opening tar file

Anand Balachandran Pillai abpillai at gmail.com
Fri Jun 4 14:51:50 CEST 2010


On Fri, Jun 4, 2010 at 6:16 PM, Anand Balachandran Pillai <
abpillai at gmail.com> wrote:

>
>
> On Fri, Jun 4, 2010 at 5:44 PM, Noufal Ibrahim <noufal at gmail.com> wrote:
>
>> On Fri, Jun 4, 2010 at 4:55 PM, murugadoss <murugadoss2884 at gmail.com>
>> wrote:
>> [..]
>> > Initially the program is written in the 32-bit linux pc. It is
>> completely
>> > working here. Today, i loaded the same program in the server pc (which
>> is a
>> > 64-bit x86 pc), i end up with issue.
>> [..]
>>
>> This is weird. Can you manually untar your file? Does your Python
>> program have sufficient privileges to read the file? I see that it's
>> in /root
>>
>
At least that doesn't seem to be the case. I simulated that condition,
and here is the result.

 >>> import tarfile
>>> tarfile.open('/root/test.tar.gz', 'r:*')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.5/tarfile.py", line 1139, in open
    return func(name, "r", fileobj)
  File "/usr/lib64/python2.5/tarfile.py", line 1200, in gzopen
    fileobj = file(name, mode + "b")
IOError: [Errno 13] Permission denied: '/root/test.tar.gz'

So that raises a different error not ReadError.


>   Well, that is getting to the raw basics. If it turns out to be that you
> didn't
>   have permission to read the file in the first place..., nothing more
>   to say - you managed to waste the time of whoever replied to this thread.
>
>
>
>
>>
>> --
>>
>> ~noufal
>> http://nibrahim.net.in
>> _______________________________________________
>> BangPypers mailing list
>> BangPypers at python.org
>> http://mail.python.org/mailman/listinfo/bangpypers
>>
>
>
>
> --
> --Anand
>
>
>
>


-- 
--Anand


More information about the BangPypers mailing list