classification
Title: os.path.is*() may return False if path can't be accessed
Type: Stage:
Components: Documentation Versions: Python 3.3, Python 3.2, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: cameron, christian.heimes, docs@python, eric.araujo, ezio.melotti, georg.brandl, giampaolo.rodola, ncoghlan, pitrou
Priority: normal Keywords:

Created on 2012-06-29 00:19 by giampaolo.rodola, last changed 2012-06-29 03:54 by ncoghlan.

Messages (3)
msg164307 - (view) Author: Giampaolo Rodola' (giampaolo.rodola) (Python committer) Date: 2012-06-29 00:19
It seems a doc fix is the best way to go, in which case I leave this one to a native English speaker:
http://mail.python.org/pipermail/python-dev/2012-June/120788.html

Alternatively a new 'strict' parameter has been proposed as a workaround:
http://mail.python.org/pipermail/python-dev/2012-June/120800.html
msg164309 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-06-29 00:50
-1 on a "strict" parameter. This is a pointless obfuscation of the API.
msg164312 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2012-06-29 03:54
The os.path.exists() docs already cover all the gory details of when it may be false due to limited permissions. The is* docs refer to this by their use of the word "existing", but that's probably too subtle.

I suggest adding an extra sentence to the docs of all affected functions:

"This always returns False if os.path.exists(path) returns False."
History
Date User Action Args
2012-06-29 03:54:52ncoghlansetmessages: + msg164312
2012-06-29 00:50:25pitrousetnosy: + pitrou
messages: + msg164309
2012-06-29 00:43:24cameronsetnosy: + cameron
2012-06-29 00:19:48giampaolo.rodolacreate