我有一个cherrypy 应用程序,我通过wxpython ui 控制http。我想在 ui 关闭时杀死服务器,但我不知道该怎么做。现在我只是在窗口关闭事件上做一个 sys.exit() 但这导致
Traceback (most recent call last):
File "ui.py", line 67, in exitevent
urllib.urlopen("http://"+server+"/?sigkill=1")
File "c:\python26\lib\urllib.py", line 87, in urlopen
return opener.open(url)
File "c:\python26\lib\urllib.py", line 206, in open
return getattr(self, name)(url)
File "c:\python26\lib\urllib.py", line 354, in open_http
'got a bad status line', None)
IOError: ('http protocol error', 0, 'got a bad status line', None)
那是因为我没有正确停止cherrypy吗?