Bottle web framework - How to stop?

前端 未结 11 1309
不知归路
不知归路 2020-12-14 06:55

When starting a bottle webserver without a thread or a subprocess, there\'s no problem. To exit the bottle app -> CTRL + c.

In a thread, ho

11条回答
  •  孤城傲影
    2020-12-14 07:50

    I had trouble closing a bottle server from within a request as bottle seems to run requests in subprocesses.

    I eventually found the solution was to do:

    sys.stderr.close()
    

    inside the request (that got passed up to the bottle server and axed it).

提交回复
热议问题