CherryPy Hello World error

前端 未结 10 1117
广开言路
广开言路 2020-12-31 07:32

When I am running CherryPy Hello World:

import cherrypy

class HelloWorld:
    def index(self):
        return \"Hello world!\"
    index.exposed = True

che         


        
10条回答
  •  长情又很酷
    2020-12-31 08:20

    I had the same problem when running CherryPy 3.2.2 on my Win7 PC with Python 3.3 The server would start normally and then would crash in about a couple of minutes.

    I've applied the patch from CherryPy 3.2.3 laurasia mentioned. But it didn't help.

    So I had to comment out the lines raising the error at the very end of python\Lib\site-packages\cherrypy\process\servers.py to prevent the server from dying:

    ...
    #    if host == client_host(host):
    #        raise IOError("Port %r not bound on %r" % (port, host))
    ...
    

提交回复
热议问题