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 paulenet
Recipients WildCard65, eryksun, paulenet, shreyanavigyan
Date 2021-05-06.18:16:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1620325002.86.0.375754403848.issue44046@roundup.psfhosted.org>
In-reply-to
Content
"The most easy way to do is right click on the application you're running the code from, click Run as Administrator and then run the code in that application. You'll not get any WinError. And also being in the Administrators group doesn't mean whatever application you run has the permission. You have the permission to do manually not the application right? I'm saying this because I'm the admin of my computer still Python raises WinError if I run it normally. Being the admin of my computer I still have to run Python in elevated mode. Windows considers Python as a third party app and it'll not give admin access to it so easily."

@Shreyan, Yes, totally understand that.  I am also keenly aware of this, because often times for low-level, environment-related solutions in Visual Studio, I have had to set Visual Studio IDE to run as administrator in order for certain operations to function properly.  In the case of Python, I am currently using VSCode.  When I have set code.exe to run as administrator, and configure python.exe to run as administrator under Compatibility mode, then both VS Code and Python starts acting strange.  From the IDE, I can no longer run in debug mode, and any output that is generated is launched in a separate console window, which is viewable only briefly.

So... what I also tried was just eliminating VS Code from the equation at the moment.  I run a DOS console as Administrator, then just call Python directly along with the .py, and the WinError 5 stops getting thrown.  However, the other thing I noticed is that when python.exe is set to run as administrator under Compatibility Mode, and you reopen solution in VS Code, I noticed that the winregistry library stops getting recognized.
History
Date User Action Args
2021-05-06 18:16:42paulenetsetrecipients: + paulenet, eryksun, WildCard65, shreyanavigyan
2021-05-06 18:16:42paulenetsetmessageid: <1620325002.86.0.375754403848.issue44046@roundup.psfhosted.org>
2021-05-06 18:16:42paulenetlinkissue44046 messages
2021-05-06 18:16:42paulenetcreate