Python Forum
Has anyone experience a winError[5] Access Denied in Windows 10? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Has anyone experience a winError[5] Access Denied in Windows 10? (/thread-22388.html)



Has anyone experience a winError[5] Access Denied in Windows 10? - fstkmaro - Nov-11-2019

Hello, I am running a script that turns into an error when running one of the built in scripts in Python (subprocess.py). The error appears to be Windows related but I am not sure. I was wondering if anyone had experience this error and could point me to a potential solution. I am running this script from VSC (Visual Studio Code) using Python3 in powershell. The following is my traceback:

Error:
[i]ERROR (78 seconds). Unexpected error occured during 'Update' procedure. Exception: Traceback (most recent call last): File "c:/TouchGFXProjects/769_try/ideScripts/update.py", line 56, in <module> makefileData = makefile.getMakefileData(makeExePath, gccExePath) File "c:\TouchGFXProjects\769_try\ideScripts\updateMakefile.py", line 93, in getMakefileData projectName = self.getMakefileVariable(makeExePath, gccExePath, self.mkfStr.projectName)[0] File "c:\TouchGFXProjects\769_try\ideScripts\updateMakefile.py", line 366, in getMakefileVariable proc = Popen(arguments, stdout=PIPE) File "C:\Users\omis2\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 854, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\omis2\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1307, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, PermissionError: [WinError 5] Access is denied[/i]
I have tried changing my permissions to the C folder by setting myself as an admin to no avail. Note that the original script is in drive D while the python installation is in the c:\user\username\app data\programs\python path.

Thank you very much in advance for any help


RE: Has anyone experience a winError[5] Access Denied in Windows 10? - Gribouillis - Nov-11-2019

I'm not a Windows user but it would be a good idea to get the command that python tries to call by printing the arguments before the statement proc = Popen(arguments, stdout=PIPE) at line 366 in updateMakefile.py. If these arguments are for example ['spam.exe', '-s', 'eggs', 'ham'] then you could
  • check that the program can access spam.exe (permissions)
  • try the command spam.exe -s eggs ham in a terminal (cmd window) to see if it runs correctly.



RE: Has anyone experience a winError[5] Access Denied in Windows 10? - fstkmaro - Nov-11-2019

(Nov-11-2019, 07:10 AM)Gribouillis Wrote: I'm not a Windows user but it would be a good idea to get the command that python tries to call by printing the arguments before the statement proc = Popen(arguments, stdout=PIPE) at line 366 in updateMakefile.py. If these arguments are for example ['spam.exe', '-s', 'eggs', 'ham'] then you could
  • check that the program can access spam.exe (permissions)
  • try the command spam.exe -s eggs ham in a terminal (cmd window) to see if it runs correctly.

Thanks very much for the response. I will be looking into it.

regards,