[Python-Dev] os.path.exists() / os.path.isdir() inconsistency when dealing with gvfs directories (original) (raw)

Hans Mulder hansmu at xs4all.nl
Wed Jun 27 15:10:33 CEST 2012


On 27/06/12 02:19:03, Giampaolo RodolĂ  wrote:

2012/6/27 Cameron Simpson <cs at zip.com.au>:

So I'd be +0.5 for making the docs more clear that True is reliable and False may merely mean "could not access". +1

+1

I was about to propose a 'strict' parameter which lets the exception propagate in case of errno != EACCES/EPERM but a doc fix is probably just fine. I'll file a bug report later today.

A 'strict' parameter that just propagates the exception might be a good idea. That would allow the user to deal with whatever issues stat() encounters.

Arbitrarily mapping EPERM to 'False' would be unhelpful, as it leaves the user in a position where one value can mean two different things.

-- HansM



More information about the Python-Dev mailing list