os.path.isdir strange behaviouring
Thomas Mangin
thomasm at legend.co.uk
Tue Jun 20 04:39:35 EDT 2000
> >I notice that if a directory is root owned and chmoded 700 (let say
/test)
> >and if it contain a directory called test2
> >os.path.isdir("/test/test2") return 0 if called by a "normal user"
> >I was expecting an exception.
>
> Why were you expecting an exception?
I created few directories for my application as "myself" but I am running
the script as a cgi.
drwx------ thomas thomas [somwehere in the world]/test
drwx------ thomas thomas [somwehere in the world]/test/test2
my web server and I are different users, as "nobody" have no read/go
through access on the parent (test) directory I am checking, it can not even
try to perform any action on the child one (test2).
Nothing with the current return code indicate that the test failed.
I was just guessing : return 0 means no directory present, not enable to
perform the requested action ..
Thomas
More information about the Python-list
mailing list