[issue9311] os.access can return bogus values when run as superuser

R. David Murray report at bugs.python.org
Tue Jul 20 16:16:49 CEST 2010


R. David Murray <rdmurray at bitdance.com> added the comment:

I'm curious, are the perl and sh functions you say do the right thing wrappers around 'access', or are they some other sort of function?  The Python code is just a thin wrapper around the system function, and as such will follow the system function's semantics.

I do agree that the FreeBSD interpretation of the semantics of access is...unexpected, as well as unfortunate :)  So, a doc note about the superuser X_OK quirk is appropriate.  Care to propose a doc patch?  Personally I wouldn't include the stat example, but rather simply refer to stat as the portable way to check if the execute bit is set (and then you still have to call os.access to see if the real uid has permission to execute).

On the other hand, proposing a portable version of 'access' for inclusion in shutils might be appropriate, if you want to open a new issue for that (preferably with a patch including docs and unit tests :)

----------
assignee:  -> docs at python
components: +Documentation -Library (Lib)
nosy: +docs at python, r.david.murray
stage:  -> needs patch
versions: +Python 2.7, Python 3.1, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9311>
_______________________________________


More information about the Python-bugs-list mailing list