sanic icon indicating copy to clipboard operation
sanic copied to clipboard

启动报错

Open f754699 opened this issue 7 months ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Describe the bug

 File "F:\pythonproject\sanicResolve2\.venv\Lib\site-packages\sanic\mixins\startup.py", line 1180, in serve
    while cls._get_process_states(worker_state):
                                  ^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'worker_state' where it is not associated with a value

Code snippet

from sanic import Sanic, text, json

app = Sanic("fuwu")

if __name__ == '__main__':
    app.run(host="0,0,0,0", port=8000, )

Expected Behavior

启动就报错,

How do you run Sanic?

as a model

Operating System

Windows

Sanic Version

sanic = {extras = ["ext"], version = "^24.6.0"}

Additional context

No response

f754699 avatar Jul 13 '24 13:07 f754699