Ren'Py RenPy error at game startup

Levian

Newbie
Mar 9, 2018
81
49
Some RenPy games have started crashing when starting. Here's an error message:

Code:
```
I'm sorry, but an uncaught exception occurred.

While running game code:
  File "game/Cell01_ArtDIVISION.rpy", line 1746, in <module>
Exception: Could not load Live2D. b'/private/var/folders/yh/cm8swrdx44lg5s_t5_jspfm40000gn/T/AppTranslocation/B2EF704D-17FB-4386-AE91-653F61A2FA2D/d/Once a Porn a Time Chapt2 v0.8.app/Contents/MacOS/libLive2DCubismCore.dylib' was not found.

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

Full traceback:
  File "Cell01_ArtDIVISION.rpyc", line 1746, in script
  File "/private/var/folders/yh/cm8swrdx44lg5s_t5_jspfm40000gn/T/AppTranslocation/B2EF704D-17FB-4386-AE91-653F61A2FA2D/d/Once a Porn a Time Chapt2 v0.8.app/Contents/Resources/autorun/renpy/ast.py", line 1237, in execute
    img = renpy.python.py_eval_bytecode(self.code.bytecode)
  File "/private/var/folders/yh/cm8swrdx44lg5s_t5_jspfm40000gn/T/AppTranslocation/B2EF704D-17FB-4386-AE91-653F61A2FA2D/d/Once a Porn a Time Chapt2 v0.8.app/Contents/Resources/autorun/renpy/python.py", line 1146, in py_eval_bytecode
    return eval(bytecode, globals, locals)
  File "game/Cell01_ArtDIVISION.rpy", line 1746, in <module>
  File "/private/var/folders/yh/cm8swrdx44lg5s_t5_jspfm40000gn/T/AppTranslocation/B2EF704D-17FB-4386-AE91-653F61A2FA2D/d/Once a Porn a Time Chapt2 v0.8.app/Contents/Resources/autorun/renpy/gl2/live2d.py", line 566, in __init__
    common = self.create_common(default_fade)
  File "/private/var/folders/yh/cm8swrdx44lg5s_t5_jspfm40000gn/T/AppTranslocation/B2EF704D-17FB-4386-AE91-653F61A2FA2D/d/Once a Porn a Time Chapt2 v0.8.app/Contents/Resources/autorun/renpy/gl2/live2d.py", line 510, in create_common
    rv = Live2DCommon(self.filename, default_fade)
  File "/private/var/folders/yh/cm8swrdx44lg5s_t5_jspfm40000gn/T/AppTranslocation/B2EF704D-17FB-4386-AE91-653F61A2FA2D/d/Once a Porn a Time Chapt2 v0.8.app/Contents/Resources/autorun/renpy/gl2/live2d.py", line 186, in __init__
    init()
  File "/private/var/folders/yh/cm8swrdx44lg5s_t5_jspfm40000gn/T/AppTranslocation/B2EF704D-17FB-4386-AE91-653F61A2FA2D/d/Once a Porn a Time Chapt2 v0.8.app/Contents/Resources/autorun/renpy/gl2/live2d.py", line 93, in init
    onetime_init()
  File "/private/var/folders/yh/cm8swrdx44lg5s_t5_jspfm40000gn/T/AppTranslocation/B2EF704D-17FB-4386-AE91-653F61A2FA2D/d/Once a Porn a Time Chapt2 v0.8.app/Contents/Resources/autorun/renpy/gl2/live2d.py", line 66, in onetime_init
    raise Exception("Could not load Live2D. {} was not found.".format(dll))
Exception: Could not load Live2D. b'/private/var/folders/yh/cm8swrdx44lg5s_t5_jspfm40000gn/T/AppTranslocation/B2EF704D-17FB-4386-AE91-653F61A2FA2D/d/Once a Porn a Time Chapt2 v0.8.app/Contents/MacOS/libLive2DCubismCore.dylib' was not found.

macOS-10.14.6-x86_64-i386-64bit x86_64
Ren'Py 8.1.1.23060707
  v0.8
Thu Nov 23 21:30:56 2023
```
Can anyone decipher what could cause this?
I have a late 2012 Macbook Pro with running Mojave 10.14.6 so yeah, the equipment is old but this only relates to some games, like the one in the example code. Same error happens when trying to open the game from RenPy developer so the issue is not the game package.
 

Winterfire

Forum Fanatic
Respected User
Game Developer
Sep 27, 2018
4,955
7,273
Hold shift while opening the game, then on Graphics Acceleration pick OpenGL and try again
 

Levian

Newbie
Mar 9, 2018
81
49
Hold shift while opening the game, then on Graphics Acceleration pick OpenGL and try again
Thanks, but I didn't even get any menu while holding shift (or shift+G). Same thing, game tries to start and immediately crashers.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,145
14,830
Code:
```
  File "game/Cell01_ArtDIVISION.rpy", line 1746, in <module>
Exception: Could not load Live2D. b'/private/var/folders/yh/cm8swrdx44lg5s_t5_jspfm40000gn/T/AppTranslocation/B2EF704D-17FB-4386-AE91-653F61A2FA2D/d/Once a Porn a Time Chapt2 v0.8.app/Contents/MacOS/libLive2DCubismCore.dylib' was not found.
```
Can anyone decipher what could cause this?
The cause is a missing library file, what probably mean that either the MacOS X port have been rushed, or that the MacOS X distribution have some issues.
 

Levian

Newbie
Mar 9, 2018
81
49
The cause is a missing library file, what probably mean that either the MacOS X port have been rushed, or that the MacOS X distribution have some issues.
I also downloaded the Windows version and tried that in Renpy and got the same error. The same Win versions yet works in Windows machine I tested.

Mac port (at least) includes the missing files (e.g. 'libLive2DCubismCore.dylib') as I checked. Of course it's possible they are corrupted, but it's not just one game where this has appeared. Very odd.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,145
14,830
Mac port (at least) includes the missing files (e.g. 'libLive2DCubismCore.dylib') as I checked.
Okay, taking a closer look at Ren'Py core, the error message is half misleading.
When it say that "Could not load Live2D. b'[path to]/libLive2DCubismCore.dylib' was not found", the fact that the file was not found is just assumed to be the cause of the error. But the exception will be thrown whatever the reason why the library haven't been loaded.

What lead to another question: is your Mac running a M1 CPU ?
The support for them is still far to be complete, and an incompatibility between the Live2D library and it would explain the issue you're facing.
 

Levian

Newbie
Mar 9, 2018
81
49
What lead to another question: is your Mac running a M1 CPU ?
The support for them is still far to be complete, and an incompatibility between the Live2D library and it would explain the issue you're facing.
Wish it was, this runs on an over decade old Intel Core 7. I'm guessing there's not anymore support for this hardware/OS but haven't found if it is so.
 

sleepingkirby

Member
Aug 8, 2017
392
567
This is a stab in the dark. But since it explicitly says that the file could not be found. Can you make sure the file a) does exist as it is written (If the creator of the game created the port in windows, there's always the case insensitivity or file/path name space. Like copy and paste the path from the output. I know with long paths like that, I usually miss small things.), and b) the permissions are correct so that the program can access it (like, run chmod 777 on the file for now to test if it still doesn't find it.). It may be a possibility that the compression format included permissions that isn't right for mac's.

Usually, for programs or scripts, file not found and file not loaded are 2 different messages. Again, shot in the dark. I haven't touched mac in years.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,145
14,830
Usually, for programs or scripts, file not found and file not loaded are 2 different messages.
But it isn't the case here:
Python:
def onetime_init():
    global did_onetime_init

    if did_onetime_init:
        return

    if renpy.windows:
        dll = "Live2DCubismCore.dll"
    elif renpy.macintosh:
        dll = "libLive2DCubismCore.dylib"
    else:
        dll = "libLive2DCubismCore.so"

    fn = os.path.join(os.path.dirname(sys.executable), dll)
    if os.path.exists(fn):
        dll = fn

    if not PY2:
        dll = dll.encode("utf-8")

    if not renpy.gl2.live2dmodel.load(dll): # type: ignore
        raise Exception("Could not load Live2D. {} was not found.".format(dll))
Since the error message explicitly include the path to the library, it mean that the file exist, and have been found by Python when calling os.path.exists. Therefore the error can only come from the UTF-8 encoding, or from the OS that effectively can't load the DLL.
And it don't seem that there's none ASCII characters in the path ; unless MacOS X marked them with an underscore, in which case there's possibly two of them.
 

sleepingkirby

Member
Aug 8, 2017
392
567
But it isn't the case here:
Python:
def onetime_init():
    global did_onetime_init

    if did_onetime_init:
        return

    if renpy.windows:
        dll = "Live2DCubismCore.dll"
    elif renpy.macintosh:
        dll = "libLive2DCubismCore.dylib"
    else:
        dll = "libLive2DCubismCore.so"

    fn = os.path.join(os.path.dirname(sys.executable), dll)
    if os.path.exists(fn):
        dll = fn

    if not PY2:
        dll = dll.encode("utf-8")

    if not renpy.gl2.live2dmodel.load(dll): # type: ignore
        raise Exception("Could not load Live2D. {} was not found.".format(dll))
Since the error message explicitly include the path to the library, it mean that the file exist, and have been found by Python when calling os.path.exists. Therefore the error can only come from the UTF-8 encoding, or from the OS that effectively can't load the DLL.
And it don't seem that there's none ASCII characters in the path ; unless MacOS X marked them with an underscore, in which case there's possibly two of them.
Oh, I thought the program might have relied on the OS to raise an exception or get the exception error message. This is why you shouldn't write your own exception messages if you can help it. Bad programming practice. Thank you for updating/correcting me.

I don't suppose renpy.gl2.live2dmodel has a property or method somewhere that will store error messages. Or am I expecting too much from live2d?

I would still double check permission just in case. Only because it's a simple thing to try, if this game came in a tarbal, it might preserve permission and path exists is different than can read and/or load.

But yeah, you're right. If those fail, just might not be supported.
 
  • Like
Reactions: Levian

Levian

Newbie
Mar 9, 2018
81
49
Checked the permissions: I ran the chmod 777 to that specific file and then all the files in the app, but didn't get any change.
Maybe I need to give up on this. Thanks for all your help!
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,145
14,830
Oh, I thought the program might have relied on the OS to raise an exception or get the exception error message.
It let the OS do it, but it rarely use what the OS return. Strictly speaking it's not a fault to works that way because the OS level errors are rarely significant for the players, and even for the game's devs.
Take that case by example. Live2D library is just one among the many libraries that Ren'Py use, and not the first one to be loaded. If the others can be used but not this one, it mean that the error isn't something that can be solved by the player, like a right issue by example.


I don't suppose renpy.gl2.live2dmodel has a property or method somewhere that will store error messages. Or am I expecting too much from live2d?
Whatever if it have it or not, the error happen when Ren'Py is linking to the library, therefore when the OS try to load it and make it available. There's a possibility that it happen when the library try to init itself, but it can also come from an entry table not recognized by the system.

I searched a bit on the net, there's few people who have the same issue, and apparently it don't limits to Ren'Py. So, it's perhaps something related to Live2D requirements. For license reason, Live2D do not come with Ren'Py and have to be installed by the game dev. Therefore the recent versions can have more restriction than the one expected by Ren'Py.
 

sleepingkirby

Member
Aug 8, 2017
392
567
It let the OS do it, but it rarely use what the OS return. Strictly speaking it's not a fault to works that way because the OS level errors are rarely significant for the players, and even for the game's devs.
Take that case by example. Live2D library is just one among the many libraries that Ren'Py use, and not the first one to be loaded. If the others can be used but not this one, it mean that the error isn't something that can be solved by the player, like a right issue by example.
Let's agree to disagree on this point. Because OS errors, as in errors from the OS level for file system, especially if we're talking macs that's using openbsd, the error messages aren't helpful to the end user, but they are helpful to the devs in that they're the same error messages that's been around for decades upon decades. Like, if you look at open() in openBSD's documentation, it'll return things like ENOTDIR or EACCESS. In fact, those were the types of messages I assumed a check like this would have relied on since those are the OS system calls that, I assume, any interpreter hooking into the OS would use. (Unless the interpreter is the one throwing those messages out, at which point...that's a pretty bad interpreter and I wouldn't want to touch it with a ten foot pole.)


Whatever if it have it or not, the error happen when Ren'Py is linking to the library, therefore when the OS try to load it and make it available. There's a possibility that it happen when the library try to init itself, but it can also come from an entry table not recognized by the system.
I think my main gripe is that if you need to manually write an error message, make it better than the "check engine" light. Like, whoever wrote that assumed that load() can ONLY fail if the file is not found. Like, imagine if opening a database file (like if you're doing "sqlite ./somedbfile.db" or something similar), the database system assumes that failure to open it can ONLY be that the file is missing. Not that the file being loaded is not a database file or that database was corrupted. Wouldn't that drive you nuts? Like wouldn't it better to say "load() failed at path <path>. Details to be followed: <insert any errors anything else reports.>" When I read "Could not load Live2D. {} was not found.", I was like "Did they mean to fill in {} with a class name? Is {} a class or a set/tuple and that's what it's looking for?" Like, I like to write error messages to what happened, not what I assume the outcome to be. But maybe that's just me. I have worked with a lot of bad documentation and error reporting in libraries and infrastructure in the past. (glares at M$ Azure)


I searched a bit on the net, there's few people who have the same issue, and apparently it don't limits to Ren'Py. So, it's perhaps something related to Live2D requirements. For license reason, Live2D do not come with Ren'Py and have to be installed by the game dev. Therefore the recent versions can have more restriction than the one expected by Ren'Py.
Yeah, I saw the same thing. I looked it up after your previous reply to me. Live2d is apparently referring to Live2dCubism which is a paid library/software that is implemented in more than just Ren'Py. Ren'Py's documentation even says that a dev needs to download it separately outside of Ren'Py. There isn't even documentation I can look up for minimum specs or error reporting or anything. I really wish commercial software did better in terms of documentation. Oh, and backwards compatibility. But maybe that's asking too much from python.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,145
14,830
Let's agree to disagree on this point. Because OS errors, as in errors from the OS level for file system, especially if we're talking macs that's using openbsd, the error messages aren't helpful to the end user, but they are helpful to the devs in that they're the same error messages that's been around for decades upon decades.
Sorry, but I have to correct you here.

Firstly, due to its Darwin inheritance, MacOS X have more code coming from FreeBSD than from OpenBSD. With MacOS X, Apple even synchronized all its BSD layer with FreeBSD 5, to definitively get rid of its patchwork of BSD inheritance. And starting there, they stopped to import BSD code.

Secondly, this is assuming that the game dev own a Mac, what is rarely the case. For their vast majority, they just ask Ren'Py to generate the Linux and MacOS distribution, expecting them to be correct ; what happen 99,99% of the time.

Thirdly, as I said this is not the kind of error that are common with Ren'Py, because they have no reason to happen ; especially at this level. If Ren'Py can starts, then the only effective file IO error that can happen is a write access for the log file. In which case the error message is explicit: "IOError: [Errno 30] Read-only file system"
Even save files wouldn't trigger an error, because Ren'Py double them. One copy is stored on a directory that will explicitly have the correct rights.
This leave only one possibility in terms of IO error, a missing file. But here the possibilities are even more limited. It can only be a game file if the dev haven't tested his game prior to the distribution building, or totally messed his building rules (but 99% of the devs do not change them). What mean that a missing file mostly come from a corrupted archive, and therefore the error message will appear when uncompressing the game.

The case presented in this thread is really particular, because involving a third party library that do not regard Python and have to be partly installed by the game dev. Something that, so far, only happen when the game need the Live2D support.
And, once again, having the error status returned by the OS wouldn't help.


Like, if you look at open() in openBSD's documentation, it'll return things like ENOTDIR or EACCESS. In fact, those were the types of messages I assumed a check like this would have relied on since those are the OS system calls that, I assume, any interpreter hooking into the OS would use.
The dev provide the Live2D SDK archive, then Ren'Py SDK install the files it will need for the distributions, ensuring that they are put at the right place, and with the correct rights. This mean that ENOTDIR is not a possibility, because the library is stored in the same directory than the Python interpreter. If the directory do not exist, Ren'Py will not starts at all. And it also remove EACCESS as a possibility, unless the game dev voluntarily messed with the rights.
ENOENT is excluded too, due to the impossibility to get a ENOTDIR status and the fact that it's not a creation. Same for ENAMETOOLONG. The only possibility to get it is to reach the 32,767 characters limits for a MacOS path, will this even happen one day ?
ELOOP and EISDIR can't happen due to the way the distribution are built by Ren'Py. And if it was an EINVAL or EPERM error, all Ren'Py games using Live2D would be impacted.
EMFILE is really unlikely to happen, and it apply even more for ENFILE.
As for ENXIO, EINTR, EOPNOTSUPP, EWOULDBLOCK and EBUSY they aren't a possibility here. Same for EROFS, ENOSPC, EDQUOT, ETXTBSY and EEXIST since it's not a creation.

This only leave two possibilities at this level, EIO and ENOENT. And there's near to no software that handle the EIO case as a specific error.


Like, whoever wrote that assumed that load() can ONLY fail if the file is not found.
Because, as explained above, it's the only error expected to happen at that level.

The error that PyTom made is to not take into account the fact that here Ren'Py is loading a fully third party library he have no control over. He designed the code like for the other libraries, that are all provided with the SDK, and therefore validated as compatible in the range of Ren'Py OSes requirement. While, as I said, here it's not the case. The library isn't previously validated as having the same compatibility requirement than Ren'Py.
What is missing isn't to handle the access error, but to discriminate between a file error (can't access the file), a system error (the library isn't valid), and a purely software error (the library can not be used with this configuration).


Like, imagine if opening a database file (like if you're doing "sqlite ./somedbfile.db" or something similar), the database system assumes that failure to open it can ONLY be that the file is missing.
If the said database file is provided with the software, installed in the same time than it, and in read only access, it's perfectly legit. It can only be corrupted during the installation, and the error will be handled at that time. It can only be on an accessible part of the file system, and all. The only error that can happen, is that the file disappeared, or have never existed.
Exactly like for a library that have to be added by the dev. There's only four possibilities:
The library do not works, then the dev seen it when it tested his game.
The library have been corrupted when installing the game, and the player learned about it when uncompressing the archive.
The library is purely missing, and the error message is correct.
The library is incompatible, and it's the case missing ; but I'm not sure to what extend MacOS is verbose regarding that issue.
 

sleepingkirby

Member
Aug 8, 2017
392
567
Sorry, but I have to correct you here.

Firstly, due to its Darwin inheritance, MacOS X have more code coming from FreeBSD than from OpenBSD. With MacOS X, Apple even synchronized all its BSD layer with FreeBSD 5, to definitively get rid of its patchwork of BSD inheritance. And starting there, they stopped to import BSD code.
God damn it. I always confuse those two. Thank you for the correction. But, anyways, my point is that os file system functions should error messages like EACCESS and ENOTDIR and, thus, should be used and relied upon over, or in addition to, your own error messages.

Secondly, this is assuming that the game dev own a Mac, what is rarely the case. For their vast majority, they just ask Ren'Py to generate the Linux and MacOS distribution, expecting them to be correct ; what happen 99,99% of the time.
True, but the open documentation I'm referring to refers to standard C open().The error reporting and messages should still exist regardless of OS. Especially nowadays where C is pretty standardized even across windows and mac. More so if it's ported to, and ran on, a mac. Just because someone isn't working on a particular OS, doesn't mean they shouldn't consider it. Doubly so if the game dev plans to port to it.

Thirdly, as I said this is not the kind of error that are common with Ren'Py, because they have no reason to happen ; especially at this level.
Common or not, you don't assume. This is the kind of thing that opens up security flaws in programs and games. Always check your inputs lest you incur the wrath of little Bobby tables. (Just in case you've never heard of Little Bobby tables, Search "XKCD little bobby tables". I guess even if you do know it, search for it anyways. It's always good for a laugh.)

If Ren'Py can starts, then the only effective file IO error that can happen is a write access for the log file. In which case the error message is explicit: "IOError: [Errno 30] Read-only file system".
But none of that is true. If Ren'Py can start and then it's importing external libraries, lots can go wrong. This might be the "common" thing, but when you're doing things like loading external resources, you're no longer doing "common" things. Otherwise, this thread wouldn't even be opened. Just because it's an edge case, doesn't mean you don't deal with it.


Even save files wouldn't trigger an error, because Ren'Py double them.
One copy is stored on a directory that will explicitly have the correct rights. This leave only one possibility in terms of IO error, a missing file. But here the possibilities are even more limited. It can only be a game file if the dev haven't tested his game prior to the distribution building, or totally messed his building rules (but 99% of the devs do not change them). What mean that a missing file mostly come from a corrupted archive, and therefore the error message will appear when uncompressing the game.
*Rubs neck nervously.* Yeah... I've crashed Ren'Py games messing with save files before. So I can't say I agree. (Tried to do a binary diff on 2 different save files and applied it to a third. It was my first attempt at cheating in a Ren'py game). But also, consider this, you sym link ~/.renpy to a fat32 partition. No matter what you do, it'll never have the proper permissions. Even chmods will look like it went through fine, but the permissions won't apply. I can probably think of worse things to do, but my initial point was, you don't assume. You write the error message to what it actually happening, not what you think is or will happening.


The case presented in this thread is really particular, because involving a third party library that do not regard Python and have to be partly installed by the game dev.
Yeah, but if there's documentation in Ren'Py's page and the game dev is a beginner, how would they know this is a particular case? We can't say the dev is excused from doing out of the box because it's out of the box, but it's common practice so it's excused that they didn't take extra precautions.

Something that, so far, only happen when the game need the Live2D support.
And, once again, having the error status returned by the OS wouldn't help.
I partially agree with you. The error status from the OS wouldn't have helped, but that's because the true error wasn't from the OS. It was from the load(), but the error message returned was written like it was an OS issue. If it was written correctly, would it helped you solve the problem? Probably not. Would it have prevented you from chasing down a bad lead just because the error message was misleading, thus saving you some time? Definitely. And that's what I'm going for. Messages, particularly error messages shouldn't be misleading simply because someone assumed. I mean, look at the code:
Code:
    fn = os.path.join(os.path.dirname(sys.executable), dll)
    if os.path.exists(fn):
        dll = fn

    if not PY2:
        dll = dll.encode("utf-8")

    if not renpy.gl2.live2dmodel.load(dll): # type: ignore
        raise Exception("Could not load Live2D. {} was not found.".format(dll))
Here's all it would have taken to do what I'm advocating for:

Code:
    fn = os.path.join(os.path.dirname(sys.executable), dll)
    if os.path.exists(fn):
        dll = fn
    else:
        raise Exception("Dynamic library file does not exist. File path: {}".format(dll))

    if not PY2:
        dll = dll.encode("utf-8")

    if not renpy.gl2.live2dmodel.load(dll): # type: ignore
        raise Exception("Live2dmodel failed to load dynamic library. Dynamic library file path: {}".format(dll))
And that's all it'd take. I'm not saying whoever wrote this is bad and should be fired or whatever. But it is something simple that can be improved and save people headache and misunderstanding. Like, if I was the mentor or team lead of the programmer that did this, I'd take a sheet of paper, roll it up, bap the person lightly on the head, go "Don't skimp on error messages." and that'd be the end of it (after making sure the person write better error messages, of course). Like, I'm pretty sure I've done something previously when I did lead a team.

The dev provide the Live2D SDK archive, then Ren'Py SDK install the files it will need for the distributions, ensuring that they are put at the right place, and with the correct rights. This mean that ENOTDIR is not a possibility, because the library is stored in the same directory than the Python interpreter. If the directory do not exist, Ren'Py will not starts at all. And it also remove EACCESS as a possibility, unless the game dev voluntarily messed with the rights.
ENOENT is excluded too, due to the impossibility to get a ENOTDIR status and the fact that it's not a creation. Same for ENAMETOOLONG. The only possibility to get it is to reach the 32,767 characters limits for a MacOS path, will this even happen one day ?
ELOOP and EISDIR can't happen due to the way the distribution are built by Ren'Py. And if it was an EINVAL or EPERM error, all Ren'Py games using Live2D would be impacted.
EMFILE is really unlikely to happen, and it apply even more for ENFILE.
As for ENXIO, EINTR, EOPNOTSUPP, EWOULDBLOCK and EBUSY they aren't a possibility here. Same for EROFS, ENOSPC, EDQUOT, ETXTBSY and EEXIST since it's not a creation.

This only leave two possibilities at this level, EIO and ENOENT. And there's near to no software that handle the EIO case as a specific error.
Keep in mind, me saying the system returning those errors is not me saying those should have been reported in this particular case, because that's not the issue. I'm saying that *if* those errors are raised, they should be given to the player and/or the dev. (Or given to the player so the player can report it to the dev). My point is still that a error message should be better than a "check engine" light.


What is missing isn't to handle the access error, but to discriminate between a file error (can't access the file), a system error (the library isn't valid), and a purely software error (the library can not be used with this configuration).
Agreed. This is what I'm trying to convey. By simply having a "Could not load Live2D. {} was not found.", it doesn't discriminate between any of those cases.


If the said database file is provided with the software, installed in the same time than it, and in read only access, it's perfectly legit. It can only be corrupted during the installation, and the error will be handled at that time.
Not true at all. There can be data rot on the physical medium or if the file downloaded missed a few bits in the packet/transmission. (assuming you didn't sum check the download. That's happened to me a few times. The linux installer ran just fine. As if nothing was wrong. But on execution of the OS for the first time, things didn't work.) I've even once had a scenario where the settings of a DSL modem had MTU's set to a number that 1 particular ISP didn't like and every third to seventh file downloaded was corrupted.

Also, you don't install .db files for sqlite. They're just files. You just load them. Not that this changes, adds, or detracts your point in anyway. Just pointing it out. Sqlite is a bit different from all the other sql flavors out there in that the database file are files that you can freely toss around and doesn't need to be in a static location and heavily indexed and all that.

The library do not works, then the dev seen it when it tested his game.
Agreed.

The library have been corrupted when installing the game, and the player learned about it when uncompressing the archive.
Not always the case. See 2 paragraphs up.

The library is purely missing, and the error message is correct.
Agreed.

The library is incompatible, and it's the case missing ; but I'm not sure to what extend MacOS is verbose regarding that issue.
I assume you mean "it's the case here" rather than "it's the case missing". Which, yes, agreed. But, in this case, the loading is done at the application level, at Ren'Py's core, which means Ren'Py should report the error message, not the OS. File missing, permissions denied, all the FS stuff should be at the OS level. Loading libraries should be at the application level so the application should sending a sensible error message.

In the end, I think you and I agree on the same/similar things but in different ways. I don't know anything about you but I'm willing to guess your views are closer to that of a game dev than an application programmer. As such, you're more will to give the benefit of the doubt to, possibly janky dev tools and game libraries and game devs. Even I know how janky and broken some game dev tools can be. Where as I come from a background where, if error messages aren't maintained well and inputs aren't sanitized, other devs five years down the line might waste entire days trying to chasing down a cause to an issue that's not really a cause or someone's machine/server can get hacked and customer data might get stolen. There's waaaay less a concern of that in a game. (well, unless it's an online game, but that's a different conversation.) And honestly, that benefit of the doubt? That's admirable. Game dev is hard. I certainly won't pretend it's not. But, for me, at least, good mental framing and good coding etiquette/discipline goes a long way in preventing a lot of headaches later on.



I just want to say, I know we've gotten waaay off track from the original issue. But I just want to thank you for having a nice chill and informative (at least for me. I don't dive into python stuff often. Cards on the table, I hate python as a language. The only major language I hate more is Ruby.) conversation on tech. I don't get these kind of civil conversations often in English. Doubly so if they're about tech. So, once again, thank you.
 
!-- Place this before closing the element (if you have multiple ads, place it only once). -->