求助,关于Bottle+python运行时错误的问题,详情请进

2020-07-26 科技 125阅读
环境python 3.3.2+bottle 0.11.6+win7 专业版
刚开始学python 和bottle ,用pip安装了bottle,试着写了一个小程序,有一段时间还一切OK,但最近发现第一次打开的时候很长时间没有反应,重新刷新一次就OK了,但终端出现好多的错误提示。电脑没有其它变化,bottle是用pip安装的。
将debug=True改为False之后依然如故,请各位指点,多谢!
Python code?
1234567
from bottle import route,run @route('/')def hello(): return "Hello World!" run(host='localhost', port=8080, debug=True)
Python code?
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
Bottle v0.11.6 server starting up (using WSGIRefServer())...Listening on Hit Ctrl-C to quit. 127.0.0.1 - - [13/Jun/2013 20:26:45] "GET / HTTP/1.1" 200 12127.0.0.1 - - [13/Jun/2013 20:26:45] "GET / HTTP/1.1" 200 12Traceback (most recent call last): File "C:\Python33\lib\wsgiref\handlers.py", line 138, in run self.finish_response() File "C:\Python33\lib\wsgiref\handlers.py", line 180, in finish_response self.write(data) File "C:\Python33\lib\wsgiref\handlers.py", line 274, in write self.send_headers() File "C:\Python33\lib\wsgiref\handlers.py", line 332, in send_headers self.send_preamble() File "C:\Python33\lib\wsgiref\handlers.py", line 255, in send_preamble ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1') File "C:\Python33\lib\wsgiref\handlers.py", line 453, in _write self.stdout.write(data) File "C:\Python33\lib\socket.py", line 317, in write return self._sock.send(b)ConnectionAbortedError: [WinError 10053] 您的主机中的软件中止了一个已建立的连接。127.0.0.1 - - [13/Jun/2013 20:26:45] "GET / HTTP/1.1" 500 59----------------------------------------Exception happened during processing of request from ('127.0.0.1', 50822)Traceback (most recent call last): File "C:\Python33\lib\wsgiref\handlers.py", line 138, in run self.finish_response() File "C:\Python33\lib\wsgiref\handlers.py", line 180, in finish_response self.write(data) File "C:\Python33\lib\wsgiref\handlers.py", line 274, in write self.send_headers() File "C:\Python33\lib\wsgiref\handlers.py", line 332, in send_headers self.send_preamble() File "C:\Python33\lib\wsgiref\handlers.py", line 255, in send_preamble ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1') File "C:\Python33\lib\wsgiref\handlers.py", line 453, in _write self.stdout.write(data) File "C:\Python33\lib\socket.py", line 317, in write return self._sock.send(b)ConnectionAbortedError: [WinError 10053] 您的主机中的软件中止了一个已建立的连接。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Python33\lib\wsgiref\handlers.py", line 141, in run self.handle_error() File "C:\Python33\lib\wsgiref\handlers.py", line 368, in handle_error self.finish_response() File "C:\Python33\lib\wsgiref\handlers.py", line 180, in finish_response self.write(data) File "C:\Python33\lib\wsgiref\handlers.py", line 274, in write self.send_headers() File "C:\Python33\lib\wsgiref\handlers.py", line 331, in send_headers if not self.origin_server or self.client_is_modern(): File "C:\Python33\lib\wsgiref\handlers.py", line 344, in client_is_modern return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'TypeError: 'NoneType' object is not subscriptable During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Python33\lib\socketserver.py", line 306, in _handle_request_noblock self.process_request(request, client_address) File "C:\Python33\lib\socketserver.py", line 332, in process_request self.finish_request(request, client_address) File "C:\Python33\lib\socketserver.py", line 345, in finish_request self.RequestHandlerClass(request, client_address, self) File "C:\Python33\lib\socketserver.py", line 666, in __init__ self.handle() File "C:\Python33\lib\wsgiref\simple_server.py", line 126, in handle handler.run(self.server.get_app()) File "C:\Python33\lib\wsgiref\handlers.py", line 144, in run self.close() File "C:\Python33\lib\wsgiref\simple_server.py", line 35, in close self.status.split(' ',1)[0], self.bytes_sentAttributeError: 'NoneType' object has no attribute 'split'----------------------------------------
奇怪今天在WinXP下试一试却一切正常,难道是win7的问题?
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com