This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: os.access() doesn't recognize lack of permissions on an SMB mountpoint
Type: behavior Stage:
Components: IO Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: mvpel, ronaldoussoren
Priority: normal Keywords:

Created on 2020-08-31 15:29 by mvpel, last changed 2022-04-11 14:59 by admin.

Messages (2)
msg376156 - (view) Author: Michael Pelletier (mvpel) Date: 2020-08-31 15:29
This emerged during a fault in a fileserver mounted on a Linux machine via a Samba client mount. The access to the mountpoint was being blocked by the fileserver, but os.access() wasn't able to recognize it as unreadable:

>>> os.access('/opt/xray', os.R_OK)
True
>>> s = os.stat('/opt/xray')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
PermissionError: [Errno 13] Permission denied: '/opt/xray'
>>>

Python version is 3.6.8.
msg376188 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2020-09-01 10:47
os.access is a think wrapper around C APIs (access(2), faccessat(2)).

I don't think this is a bug in Python, a shell command like "test -r /opt/xray" will almost certainly give the same result.
History
Date User Action Args
2022-04-11 14:59:35adminsetgithub: 85843
2020-09-01 10:47:53ronaldoussorensetnosy: + ronaldoussoren
messages: + msg376188
2020-08-31 15:29:10mvpelcreate