Skip to content

启动报错 #2985

@f754699

Description

@f754699

Is there an existing issue for this?

  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions