Replies: 1 comment
-
Wow that sucks. But if your page have no choice but to use such legacy module, catching Since you don't want Or, you could write your own More broadly though, using some kind of code execution service that can restart the server if it crashes or otherwise closes is a good idea. A good start would be Docker, which NiceGUI is compatible with, and even offers a Docker image. https://nicegui.io/documentation/section_configuration_deployment#server_hosting https://hub.docker.com/r/zauberzeug/nicegui Though, I would say my deployments, I didn't use their docker image but just do python:3.12-slim and install everything from requirements.txt --no-cache-dir |
Beta Was this translation helpful? Give feedback.
-
Just a warning for others - be very careful using optparse in nicegui scripts. Not just directly (obviously little need for that) - check all modules in your import subtree too. optparse issues a hard
sys.exit
on parse errors. Python devs are aware and DGAF.Imagine my surprise when a user page called a legacy python module on my server, which unbeknownst to me uses optparse. Parser got a malformed flag and BLAMO - entire nicegui server came crashing down.
Python devs... seriously WTF... 🤦
(to be clear, this issue is not nicegui's fault in any way. 100% blame on python stdlib)
Beta Was this translation helpful? Give feedback.
All reactions