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: An issue about os.access
Type: performance Stage: resolved
Components: Windows Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: berlinsaint, eryksun, loewis, paul.moore, serhiy.storchaka, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2015-09-20 05:43 by berlinsaint, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
1.png berlinsaint, 2015-09-20 05:49
Messages (5)
msg251145 - (view) Author: yangyanbo (berlinsaint) Date: 2015-09-20 05:43
On Windows 10 . The telnet function is closed on Windows10, I open it and I can use it in WIN CMD.
But when i start python shell,and import os module, I use the command
os.acess(r"C:\Windows\System32\telnet.exe",os.X_OK)  to check it is or not be executeable,And I got False.
Why I use it because winpexpect moudle use it to check.
I try this in three PCS,and i doubt it may be an issue
msg251146 - (view) Author: yangyanbo (berlinsaint) Date: 2015-09-20 05:49
I wrote error ,it should be os.access, and the issue is really exist
msg251148 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-09-20 06:05
This looks as a duplicate of issue2528.
msg251163 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2015-09-20 11:32
> This looks as a duplicate of issue2528.

No, yangyanbo's problem is unrelated to the file's security descriptor, and it's not a bug.

telnet.exe is manually installed via "Programs and Features", which only installs a 64-bit version into System32 (despite the 32 in its name, this directory has native 64-bit executables). But yangyanbo is running 32-bit Python, so accessing "System32" gets redirected to SysWOW64 (despite the 64 in its name, this directory has 32-bit executables that run in the "Windows 32-bit on Windows 64-bit" system). 

From a 32-bit app the real System32 directory is available as "SysNative", e.g.:

    os.access(r'C:\Windows\SysNative\telnet.exe', os.X_OK)
msg251169 - (view) Author: yangyanbo (berlinsaint) Date: 2015-09-20 16:40
Thanks for  eryksun  a lot.
Yes,it did solve my problem.
And Find this Sysnative directory doesnt exsit,And I searched the msdn  then find that it is a Windows Mechanism.
All in all ,  it does prove you are right.
Thanks a lot Again
History
Date User Action Args
2022-04-11 14:58:21adminsetgithub: 69376
2015-09-20 16:40:06berlinsaintsetmessages: + msg251169
2015-09-20 11:32:10eryksunsetnosy: + eryksun
messages: + msg251163
resolution: duplicate -> not a bug

superseder: Change os.access to check ACLs under Windows ->
2015-09-20 06:05:56serhiy.storchakasetstatus: open -> closed

superseder: Change os.access to check ACLs under Windows

nosy: + serhiy.storchaka
messages: + msg251148
resolution: duplicate
stage: resolved
2015-09-20 05:49:27berlinsaintsetfiles: + 1.png

messages: + msg251146
2015-09-20 05:44:32berlinsaintsettitle: An issue about os.acess -> An issue about os.access
2015-09-20 05:43:39berlinsaintcreate