我在本地电脑上安装了flask,并且用例子建了一个web服务器,一切正常
我开始玩了,我用浏览器按住F5不停的刷新页面时,flask就崩溃了。
例子:
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!" if __name__ == "__main__":
app.run()
Traceback (most recent call last):
File "test.py", line 9, in <module>
app.run()
File "D:\Program Files\Python27\lib\site-packages\flask\app.py", line 843, in
run
run_simple(host, port, self, **options)
File "D:\Program Files\Python27\lib\site-packages\werkzeug\serving.py", line 6
94, in run_simple
inner()
File "D:\Program Files\Python27\lib\site-packages\werkzeug\serving.py", line 6
59, in inner
srv.serve_forever()
File "D:\Program Files\Python27\lib\site-packages\werkzeug\serving.py", line 4
99, in serve_forever
HTTPServer.serve_forever(self)
File "D:\Program Files\Python27\lib\SocketServer.py", line 238, in serve_forev
er
self._handle_request_noblock()
File "D:\Program Files\Python27\lib\SocketServer.py", line 297, in _handle_req
uest_noblock
self.handle_error(request, client_address)
File "D:\Program Files\Python27\lib\SocketServer.py", line 295, in _handle_req
uest_noblock
self.process_request(request, client_address)
File "D:\Program Files\Python27\lib\SocketServer.py", line 321, in process_req
uest
self.finish_request(request, client_address)
File "D:\Program Files\Python27\lib\SocketServer.py", line 334, in finish_requ
est
self.RequestHandlerClass(request, client_address, self)
File "D:\Program Files\Python27\lib\SocketServer.py", line 657, in __init__
self.finish()
File "D:\Program Files\Python27\lib\SocketServer.py", line 716, in finish
self.wfile.close()
File "D:\Program Files\Python27\lib\socket.py", line 283, in close
self.flush()
File "D:\Program Files\Python27\lib\socket.py", line 307, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
socket.error: [Errno 10053]
难道这是bug?
我在本地电脑上安装了flask,并且用例子建了一个web服务器,一切正常
我开始玩了,我用浏览器按住F5不停的刷新页面时,flask就崩溃了。求解答
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。