os.path.isdir strange behaviouring
Erno Kuusela
erno at iki.fi
Tue Jun 27 08:07:02 EDT 2000
>>>>> "Aahz" == Aahz Maruch <aahz at netcom.com> writes:
Aahz> But it's not performing any action on test or test2; it's
Aahz> performing an action on the path /test/test2. I believe it
Aahz> actually uses the OS call stat(),
yep, strace says..
stat("/tmp/dir-with-mode-000/subdir", 0xbffff63c) = -1 EACCES (Permission denied)
ie the stat call is reporting a failure to get information on that
path.
Aahz> but that doesn't really matter; the point is that whatever
Aahz> internal function gets called on the *entire* path returns
Aahz> an error, therefore the path cannot be a directory.
but it is indeed a directory - the os is just telling the you that
you are not permitted to have any information on that filesystem object
(including whether it exists).
-- erno
More information about the Python-list
mailing list