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.

Author john_miller
Recipients john_miller, paul.moore, steve.dower, tim.golden, zach.ware
Date 2020-10-15.17:36:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1602783392.97.0.0712436068375.issue42046@roundup.psfhosted.org>
In-reply-to
Content
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 Desktop, in the user directory and in directories where Administrators are permitted to write (while normal users can only read and execute).

(Permissions for the user in those directories: 
Desktop rwx, 
Username-directory rwx, 
third-location r-x for users/rwx for Administrator-user-group (with non-elevated applications))

I can write to all these places without elevation using the shell or standard applications like notepad.exe. 

Why do I have to elevate the Python-process to access such functionality? Is this related to the security-settings on python.exe or its installation-directory location?

Forcing a user to elevate the user-launched process for tasks that operate on normal user-writable files feels like a light security-risk. Because they get used to elevate Python-scripts even if the performed task by itself would not require it.

What changed compared to Python 2?
History
Date User Action Args
2020-10-15 17:36:33john_millersetrecipients: + john_miller, paul.moore, tim.golden, zach.ware, steve.dower
2020-10-15 17:36:32john_millersetmessageid: <1602783392.97.0.0712436068375.issue42046@roundup.psfhosted.org>
2020-10-15 17:36:32john_millerlinkissue42046 messages
2020-10-15 17:36:32john_millercreate