os.access not working on WIndows??
Hi, I apologise if sending this mail to you is the wrong way to treat my problem but: I have experienced a problem on my Windows system using "os.access()":
os.access("c:\Program Files\\", os.W_OK) True
From my point of view, using this as a "Testuser" with normal user permissions (on a VM):
os.getlogin() 'Testuser'
should return FALSE. Or do I miss anything here? I have tried that on an Ubuntu 20.04 WSL under my normal account which should be seen as normal user. That yields the expected result: Python 3.8.2 (default, Jul 16 2020, 14:00:26) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.
import os os.access("c:\Program Files", os.W_OK) False
I reckon this is due to the difference of handling permissions under Linux and WIndows and the documentation refers to Unix' access() man page but nevertheless I think this should either be fixed or at least be documented as not be appropriate for Windows. I found nothing about this problem on the web no matter what I searched for therefore I report it here. And by the way: os.getlogin() produces funny errror messsages on the WSL:
os.getlogin() Traceback (most recent call last): File "<stdin>", line 1, in <module> FileNotFoundError: [Errno 2] No such file or directory os.getuid() 1000
Regards Volker
participants (1)
-
vnick@freenet.de