os.remove() permission problem

Victor Subervi victorsubervi at gmail.com
Mon Nov 30 15:35:32 EST 2009


On Mon, Nov 30, 2009 at 3:21 PM, Victor Subervi <victorsubervi at gmail.com>wrote:

> Hi;
> I get the following error when I try
> os.remove(file)
>
> *OSError*: [Errno 13] Permission denied: 'particulars.py'
>       args = (13, 'Permission denied')
>       errno = 13
>       filename = 'particulars.py'
>       strerror = 'Permission denied'
>
> Here are the permissions:
>
> -rwxr-xr-x  1 root root   455 Nov 28 05:58 particulars.py
>
> When I go into the python interpreter and execute that statement, it
> succeeds. What have I missed?
>
> This is on a CentOS system. I've tried manipulating the mode to 666 and 777
but that didn't help at all. I do read from the file, then close it, but
I've tried deleting a file I don't read and come up with the same error.
TIA,
V
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091130/f1ec8257/attachment-0001.html>


More information about the Python-list mailing list