[issue42046] Unable to write to file without elevated privileges

2020-10-16 Thread Eryk Sun
Eryk Sun added the comment: > processtoken = win32security.OpenProcessToken(process, > win32con.MAXIMUM_ALLOWED) > win32security.GetTokenInformation(processtoken, > win32security.TokenMandatoryPolicy) FYI, starting with Windows 8, the system supports pseudo-handles for the access token of

[issue42046] Unable to write to file without elevated privileges

2020-10-16 Thread john_miller
john_miller added the comment: I changed the integrity-level of "C:\" to "Mandatory Label\High Mandatory Level:(OI)(NP)(IO)(NW)" which seems to have fixed the problem. Thanks for the help. I guess I must have directly or through some other application indirectly changed the integrity level

[issue42046] Unable to write to file without elevated privileges

2020-10-16 Thread Eryk Sun
Eryk Sun added the comment: > icacls.exe C:\Python38-32\python.exe lists Mandatory Label\ > Low Mandatory Level:(I)(NW) ** This might be the problem. Removing "L" > with icacls might work. > > **When a user attempts to launch an executable file, the new process is > created with the minimum of

[issue42046] Unable to write to file without elevated privileges

2020-10-16 Thread john_miller
john_miller added the comment: Short summary: >icacls.exe C:\Python38-32\python.exe lists Mandatory Label\Low Mandatory >Level:(I)(NW) ** This might be the problem. Removing "L" with icacls might >work. >User integrity level is usually "Medium" >**When a user attempts to launch an executable

[issue42046] Unable to write to file without elevated privileges

2020-10-15 Thread Eryk Sun
Eryk Sun added the comment: > Desktop rwx, > Username-directory rwx, POSIX permissions are not meaningful in Windows. Please run the following two commands in a Python script in order to show the current user and the access-control list on the directory: import subprocess

[issue42046] Unable to write to file without elevated privileges

2020-10-15 Thread john_miller
New submission from john_miller : Trying to write into a file fails with a PermissionError (PermissionError: [Errno 13] Permission denied:). Typing in a non-elevated shell (User is Administrator) C:\Users\Username\Desktop>C:\Python38-32\python.exe open("some_file.txt","w") fails on the