Renpy 7.4.4 IOError: [Errno 13] Permission denied - Sort of fixed as I'm still restoring from a backup and piecing together the other bits.

lydcreations

Member
Game Developer
May 6, 2019
300
403
It looks like the latest Windows 10 update has made Renpy stop working for me. I receive the following error:
I'm sorry, but an uncaught exception occurred.

While running game code:
IOError: [Errno 13] Permission denied

-- Full Traceback ------------------------------------------------------------

Full traceback:
File "renpy/bootstrap.py", line 326, in bootstrap
renpy.main.main()
File "renpy/main.py", line 447, in main
renpy.game.script.load_script() # sets renpy.game.script.
File "renpy/script.py", line 283, in load_script
self.load_appropriate_file(".rpyc", ".rpy", dir, fn, initcode)
File "renpy/script.py", line 718, in load_appropriate_file
rpydigest = hashlib.md5(f.read().encode("utf-8")).digest()
IOError: [Errno 13] Permission denied

Windows-10
Ren'Py 7.4.4.1439

I was using an older version of Renpy, but updated to the current version in case this was causing the error. But this didn't fix the problem. I did a search on the Renpy site and didn't find anything about this. Thanks in advance for info on how to fix.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,583
2,226
There is usually a filename or filepath listed with the Permission Denied message.
Something like...
IOError: [Errno 13] Permission denied: u'C:\\sources\\etwproviders\\fr-FR\\hapy summer\\HS_0.2.9_pc\\HS-0.2.9-pc\\renpy\\g.sgm'
-or-
IOError: [Errno 13] Permission denied: u'C:\\Users\\Joca\\Documents\\_games\\Hillside-0.5.1-pc/HQ Images/hq_charlotte_002.jpg'


That filename probably matters here. If you edited your post to move something like your username or something... I get that. But we probably need the filename... or at least the majority of it to figure stuff out.

First thing to try though is to try running the game using [Right Click] -> [Run as Administrator]... just to see if it's a Windows permissions problem. If you're running it from the RenPy SDK launcher, try running that as Admin instead.

The other thing that comes to mind is that your Antivirus is somehow flagging it due to it being upset that the game's checksum has changed due to the development process. Unlikely, but possible. Check your AV logs for peace of mind.

Edit: Also, are you talking about your game or someone else's? If it's your game... a released version or the version you are currently working on?
 
Last edited:

lydcreations

Member
Game Developer
May 6, 2019
300
403
There is usually a filename or filepath listed with the Permission Denied message.
Something like...
IOError: [Errno 13] Permission denied: u'C:\\sources\\etwproviders\\fr-FR\\hapy summer\\HS_0.2.9_pc\\HS-0.2.9-pc\\renpy\\g.sgm'
-or-
IOError: [Errno 13] Permission denied: u'C:\\Users\\Joca\\Documents\\_games\\Hillside-0.5.1-pc/HQ Images/hq_charlotte_002.jpg'


That filename probably matters here. If you edited your post to move something like your username or something... I get that. But we probably need the filename... or at least the majority of it to figure stuff out.

First thing to try though is to try running the game using [Right Click] -> [Run as Administrator]... just to see if it's a Windows permissions problem. If you're running it from the RenPy SDK launcher, try running that as Admin instead.

The other thing that comes to mind is that your Antivirus is somehow flagging it due to it being upset that the game's checksum has changed due to the development process. Unlikely, but possible. Check your AV logs for peace of mind.

Edit: Also, are you talking about your game or someone else's? If it's your game... a released version or the version you are currently working on?
Thanks for the reply. The error log is the full report that it gave me. The file in question is the script file. Figures that it would be the hardest one to replace. I can't open the file in the game folder. Within Renpy, it shows the script file on the left, but won't let me open the file. It gives me a permission denied message. The game refuses to play as it can't reach the script files. My antivirus did flag and quarantine a couple of Renpy files. But I restored the files, so I thought I was okay. And the files it removed weren't the script file that is giving me the issues.

The game in question is my own and the working version. My best guess is that the script file got corrupted and I'll have to go back to my backup file. Then try and piece together what I've done and didn't backup.
 

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,583
2,226
Okay. first things first... Reboot your computer. Seriously "switch it off and on again." works as often as it doesn't.


Next... Add:
build.include_i686 = False somewhere in your options.rpy file. That should cure the most obnoxious AV false reports (the author has acknowledged that the 32 bit version of games often false report - so this disables them).

RenPy only "runs" the .rpyc files. But if it notices a mismatch between the .rpy version and the matching .rpyc file - it rebuilds the .rpyc file.

It's usually perfectly safe to copy back all the .rpyc files back from your latest "release" version of the game into your developer folder. Doing so will cause the files used to execute the game to be updated/refreshed based on your new source files.

The .rpy files are only text files. Copy them somewhere before you attempt anything. It's highly likely you'll be able to copy them back as they are right now once you've resolved things. In fact, backup/copy your entire project folder before doing anything.

I wrote this post recently for something slightly different:
https://f95zone.to/threads/no-modul...ing-the-game-to-another-pc.75489/post-5215610
It details how to create a new RenPy project folder based on a released version of a game.
You could try following it. Unpack your "released" game. Follow the instructions to create a brand new project folder. Then copy the latest development version of the .rpy files into that folder (and any other supporting files, like new images, etc).

That might be worth a try, as it will create a 2nd new project file, based on your "live" game, but using the updated code. Maybe it won't have the error you're seeing.
 
  • Like
Reactions: lydcreations

79flavors

Well-Known Member
Respected User
Jun 14, 2018
1,583
2,226
Something else that came to me later...

Try just copying the script file using Windows Explorer. Copy it to another disk or memory card. If it won't read, you may have a failing harddisk

Additionally UnRen has a feature to convert .rpyc files back into .rpy source files. If the source really is corrupted, then you may be able to rebuild it by reverse-compiling it
(You DID back everything up before attempting to repair things, right?)
 
  • Like
Reactions: lydcreations

lydcreations

Member
Game Developer
May 6, 2019
300
403
Something else that came to me later...

Try just copying the script file using Windows Explorer. Copy it to another disk or memory card. If it won't read, you may have a failing harddisk

Additionally UnRen has a feature to convert .rpyc files back into .rpy source files. If the source really is corrupted, then you may be able to rebuild it by reverse-compiling it
(You DID back everything up before attempting to repair things, right?)
Thanks for your help. I was able to open the script file using an internet browser. I have backups, but not as recent as I should have made. I gave myself admin rights, but renpy continued to be on lock down, so no luck on that front. I restored the files that my antivirus put into quarantine, but that was what lead to the permission messages in renpy. Thinking that renpy files got corrupted in the process. Copied the internet browser info into a new notepad file, but couldn't figure out how to change the extension to rpy. Ended up restoring the backup and copying the new material from the internet browser into the backup script file. Have been working on piecing together the other various bits from other files to replace the lost info. Have noticed in my early testing that things such as a screen alignment that I hadn't changed in some time was off. Don't know why the alignment should be off now. Will continue testing and piecing together to replace the lost info and make sure that I do regular backups just in case. Thanks again.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,384
15,293
I restored the files that my antivirus put into quarantine, but that was what lead to the permission messages in renpy.
Then it's probably because you aren't anymore the owner of those files.

Right click on one of those files you restored from the quarantine, choose "property" then the security tab. There should have a line that looks like "Users (YOURNAME\Users)". Click on it and looks what rights you have regarding those files.
There's a way to solve this, but I don't trust my memory enough to give it myself ; don't want to make the situation worse either because I messed to explain correctly or because my memory betrayed me. But it shouldn't be too difficult to find help through google.
 
  • Like
Reactions: lydcreations

lydcreations

Member
Game Developer
May 6, 2019
300
403
Then it's probably because you aren't anymore the owner of those files.

Right click on one of those files you restored from the quarantine, choose "property" then the security tab. There should have a line that looks like "Users (YOURNAME\Users)". Click on it and looks what rights you have regarding those files.
There's a way to solve this, but I don't trust my memory enough to give it myself ; don't want to make the situation worse either because I messed to explain correctly or because my memory betrayed me. But it shouldn't be too difficult to find help through google.
Thanks for your reply. I believe I had similar thoughts and looked up on line how to give myself admin rights to the file that said I didn't have permission for. But even with admin rights, Renpy still had me on lock down. I couldn't open the file in notepad, but it did open with an online browser. So I took a backup version that wasn't as current as it should have been, totally my bad, and I'm piecing together the missing bits. I still don't understand why a screen that I hadn't touched since prior to the backup had major alignment issues. Best I can guess, the renpy files got corrupted somewhere between my antivirus removing renpy files and the restoration of the removed files. Still testing, but thus far I've been able to recreate everything. Will be more diligent going forward on backing up my files though. Lesson learned the hard way.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Donor
Respected User
Jun 10, 2017
10,384
15,293
Thanks for your reply. I believe I had similar thoughts and looked up on line how to give myself admin rights to the file that said I didn't have permission for. But even with admin rights, Renpy still had me on lock down.
Because Ren'py isn't admin itself. What you needed isn't to give yourself admin rights, but to assign the file to yourself.
When you're on the security tab of the file properties, if you click on the "advanced" button (on the bottom of the second information group) a new window open that will give you the identity of the file owner ; and it have to be yourself.
 

rayminator

Engaged Member
Respected User
Sep 26, 2018
3,041
3,140
in window

How do I change folder permissions?

1. Login to your computer as an admin. ...
2. Right-click on the file or folder you want to change permissions and select Properties. ...
3. Select the Security tab. ...
4. Select the user you want to modify permissions and then click Edit.
5. To add a new user or group click on Edit and then Add. or skip to 7
6. Click Advanced and then Find now.
7. Select the user you want to add to the permission list and click OK.
8. Select the permission you want to give this folder.

Full control – User can read, write, change or delete the file.
Modify – User can read, write and change the file.
Read & execute – User can read or run the selected file.
List folder contents – User can view the files in the selected folder.
Read – User can open the file.
Write – User can edit the file or create new files.

9. If you can’t change the permission and the area is grayed out. You have to go back to the security tab, click Advanced, and unchecked Replace all child object permission entries with inheritable permission entries from this object. Hit Apply and repeat step 8.
 

lydcreations

Member
Game Developer
May 6, 2019
300
403
Because Ren'py isn't admin itself. What you needed isn't to give yourself admin rights, but to assign the file to yourself.
When you're on the security tab of the file properties, if you click on the "advanced" button (on the bottom of the second information group) a new window open that will give you the identity of the file owner ; and it have to be yourself.
Thanks for your reply. Sorry, I didn't include all of the steps I tried to resolve the permissions issue. I did go into the security tab of the file to verify what rights I had for the file. All of my computer users had allow access for everything but special permissions. But Renpy still said I didn't have permission to the file. While I couldn't open the file using notepad, I was able to open the file using my internet browser. This gave me the impression that I was dealing with corrupted files, so I restored from my backup and this fixed the permission error.
 

lydcreations

Member
Game Developer
May 6, 2019
300
403
in window

How do I change folder permissions?

1. Login to your computer as an admin. ...
2. Right-click on the file or folder you want to change permissions and select Properties. ...
3. Select the Security tab. ...
4. Select the user you want to modify permissions and then click Edit.
5. To add a new user or group click on Edit and then Add. or skip to 7
6. Click Advanced and then Find now.
7. Select the user you want to add to the permission list and click OK.
8. Select the permission you want to give this folder.

Full control – User can read, write, change or delete the file.
Modify – User can read, write and change the file.
Read & execute – User can read or run the selected file.
List folder contents – User can view the files in the selected folder.
Read – User can open the file.
Write – User can edit the file or create new files.

9. If you can’t change the permission and the area is grayed out. You have to go back to the security tab, click Advanced, and unchecked Replace all child object permission entries with inheritable permission entries from this object. Hit Apply and repeat step 8.
Thanks for your post. I did access the security tab of the file and it showed that I was allowed everything but special permission for the file. Restoring from my backup fixed the permission issue, so I have the impression that some files got corrupted.