Help, gives an error permissionerror though everything seems to be there and everything is written correctly. The error itself:

Traceback (most recent call last): File "C:\PyTake\PyTake.py", line 46, in <module> ptCallRequestsTroune.__callRequestsMode__() File "C:\PyTake\ptCallRequestsTroune.py", line 20, in __callRequestsMode__ ptRequestsTroune.__requestsMode__() File "C:\PyTake\ptRequestsTroune.py", line 33, in __requestsMode__ ptDefaultCommandsTroune.__procStandartHide__() File "C:\PyTake\ptDefaultCommandsTroune.py", line 50, in __procStandartHide__ logIdentify = open("C:\\Program Files\\PyTake v.1.0\\log\\MAIN_LOG.log", 'a') PermissionError: [Errno 13] Permission denied: 'C:\\Program Files\\PyTake v.1.0\\log\\MAIN_LOG.log' 

There is a directory, there are files. Why does not want to write ??

That's right

  • Do you have rights to write to this file? Perhaps you need to run the interpreter on behalf of the administrator, despite the fact that you are working under the administrator - LukavskyM
  • @ demol0cv But no, I used to work normally, now I don’t want to, I don’t know why, maybe something extra was added - Evleaps Corp.
  • it's worth checking, for example, to run a script from a console running from the admin - LukavskyM
  • @ demol0cv hmm ... Earned!) My laziness just killed me)) But I don’t understand, I used to write down without an administrator, now I want an admin. By the way, please do not tell me how to make it always run from Admin. For now I compile and it is necessary that everything works correctly, and recorded where necessary. Without any denied access. I would be grateful if you answer! - Evleaps Corp.
  • one
    @EvleapsCorp. just don't write the log in Program Files. Use, for example,% APPDATA% or% TEMP% for this. - Alexey Reytsman

1 answer 1

Windows requires user elevation if it accesses unavailable for writing to a regular user (in this case C: \ Program Files).

To avoid this, it is necessary to run the script with elevated privileges (despite the fact that you are already an administrator), for example, from the console running "As administrator"