Closed mucski closed 1 month ago
Are you importing a library that uses it? _ssl has never been around on web builds. Do you have the full traceback?
Are you importing a library that uses it? _ssl has never been around on web builds. Do you have the full traceback?
2024-07-22 18:29:13 UTC Emscripten-3.1.24-wasm32-32bit Ren'Py 8.2.3.24061702
Full traceback:
File "/renpy/bootstrap.py", line 359, in bootstrap
renpy.main.main()
File "/renpy/main.py", line 361, in main
load_rpe(dir + "/" + fn)
File "/renpy/main.py", line 156, in load_rpe
exec(autorun, {'file': os.path.join(fn, "autorun.py")})
File "
Before loading the script. ModuleNotFoundError: No module named '_ssl'
Where is it importing websockets from?
Where is it importing websockets from?
I have no idea, it's a default renpy sdk download, with only thing installed the web module.
Look for *.rpe files in your game folder or the Ren'Py SDK folder. There is no such file in the official SDK release you're using, so it should be in your game folder most likely. If you find rpe files in the SDK folder instead, you might have downloaded the SDK from an unsafe source that added a malware to it...
Okay, got it fixed after you mentioned .rpe, it did have an .rpe in my game directory coming from a plugin called "Renpy launch and sync". If anyone comes accross that plugin, web builds wont work.
@furudean You might want to prevent the inclusion of your rpe when the game is built for Web (or at least, make it do nothing).
Thanks for mentioning me in this. This is indeed a bug in vscode-renpy-warp. I've created a ticket to track this issue in https://github.com/furudean/vscode-renpy-warp/issues/26
I think it probably makes sense to exclude .rpe and .rpe.py files from builds. Those files are meant to extend the local install of the engine, and shouldn't go in built games.
@renpytom I agree, I'd love to not include them at all. I don't think a good mechanism to declare a .rpe
file as "development only" exists in any released version. RPEs don't have access to build.classify
in their executing context as it's not exported from renpy
, so you have to do it in another way.
One solution could be to to add a supplemental .rpy
file with build.classify("something.rpe", None)
in it, but I'm not thrilled about adding more clutter to people's projects. If you have any graceful ideas, let me know.
8.3.0 already kind solves this by allowing you to put development .rpe
s in the Ren'Py SDK, then they won't get included. I already do this on those versions, but anything older has this problematic feature of the code being included.
I mean, all the time. RPEs are ment to patch the engine for you, not everyone.
I don't think I follow
Basically, .rpes aren't meant to be a way of patching the engine for players. They're really meant to let me hotfix games that already exist, and adding devlopment paches shouldn't work. But distributing a game shouldn't also distribute rpes.
Isn't the beauty of software that people will use your features in horrifying ways? ;)
distributing a game shouldn't also distribute rpes.
Fully agreed. But what other alternatives exist in <8.30? I'll opt for this hack for now, since I want to support older versions as well.
It wouldn't be a bad idea to write a .rpy
file in the game directory that removes the RPE from the build, but definitely entering magic solution territory.
@furudean I don't know how much API this is but you can add a function to the renpy.game.post_init
list and then, in the callback, import store and get the function, something like:
from renpy.game import post_init
def remove_itself():
from renpy.python import store_dicts
store_dicts["store.build"]['classify']('**.rpe', None)
post_init.append(remove_itself)
@brunoais Nice find. I think this would be a good addition
@renpytom I've been thinking. Would it be viable to add ( "**.rpe", None),
to the first item in late_base_patterns
instead? Regardless of the intended use of rpe files, I believe that it should be more of a "ignore by default" instead of forcefully ignore.
Just my opinion
In Ren'Py 8.2.3 if you create a web build it will give the following fatal error: ModuleNotFoundError: No module named '_ssl'