0

I am running a Quart application. However, when I save any file used by the program, it crashes. I don't even have debug mode on, so it shouldn't be auto-updating.

Here's a minimal example that does exhibit this behavior on my machine:

from quart import Quart

app = Quart("test")

@app.route("/")
async def serve_root():
    return "Hello!"

if __name__ == "__main__":
    app.run(host = "0.0.0.0", port = 5000)

which I run just via python3 test.py. The error given is this:

Traceback (most recent call last):
  File "test.py", line 10, in <module>
    app.run(host = "0.0.0.0", port = 5000)
  File "/usr/local/lib/python3.8/dist-packages/quart/app.py", line 1270, in run
    loop.run_until_complete(task)
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.8/dist-packages/hypercorn/asyncio/__init__.py", line 41, in serve
    await worker_serve(app, config, shutdown_trigger=shutdown_trigger)
  File "/usr/local/lib/python3.8/dist-packages/hypercorn/asyncio/run.py", line 185, in worker_serve
    restart()
  File "/usr/local/lib/python3.8/dist-packages/hypercorn/utils.py", line 194, in restart
    os.execv(executable, [executable] + args)
OSError: [Errno 8] Exec format error

I am running this on Windows 11 via the Ubuntu WSL. My quart is up to date (I just installed it today). The application works fine, but as soon as I save, it registers the update and immediately dies.

hyper-neutrino
  • 5,272
  • 2
  • 29
  • 50
  • app.run sets `use_reloader` to True, the reloader checks for changes in files and restarts the app if there are. It seems to have an issue here - any chance your file has a space in the filename? – pgjones Dec 16 '21 at 19:30
  • @pgjones The file in my MCVE is just called `test.py`, so not here. – hyper-neutrino Dec 16 '21 at 19:41

0 Answers0