bottle icon indicating copy to clipboard operation
bottle copied to clipboard

Update CherryPy support for v 9.0.0 +

Open RichardLangFromNZ opened this issue 9 years ago • 3 comments

Current bottle (v0.12.13) is failing to import cherrypy.wsgiserver on line 2787 as it no longer exists.

[]http://docs.cherrypy.org/en/latest/history.html#v9-0-0

Work around by installing cherrypy version < 9.0.0

RichardLangFromNZ avatar Feb 02 '17 01:02 RichardLangFromNZ

A better solution is this fix that I applied inside bottle.py. There's still a wsgiserver implementation available in cherrypy, it's just moved/renamed into 'cheroot'.

    def run(self, handler):  # pragma: no cover
        # JDrew: added the 2nd import to handle the latest cherrypy not
        # supporting 'from cherrypy import wsgiserver'.
        try:
            from cherrypy import wsgiserver
        except ImportError:
            from cheroot.wsgi import Server as wsgiserver```

jasondrew avatar Mar 12 '17 18:03 jasondrew

This appears to have been fixed in be9081411 and nearby commits, but this particular issue wasn't noted in the commit message. I expect the next release will include that support for cheroot.

liffiton avatar May 04 '17 22:05 liffiton

line 3271 fixed for me:

        # from cherrypy   import           wsgiserver                                  # This will fail for CherryPy >= 9                                   ###    TODO
        from cheroot.wsgi import Server as WSGIServer
        self.options['bind_addr'] = (self.host, self.port)
        self.options['wsgi_app'] = handler

        certfile = self.options.get('certfile')
        if certfile:
            del self.options['certfile']
        keyfile = self.options.get('keyfile')
        if keyfile:
            del self.options['keyfile']

        server =              WSGIServer(**self.options)  ################# ###     wsgiserver.CherryPyWSGIServer(**                  WSGIServer.CherryPyWSGIServer(**

dimyme avatar Oct 14 '18 21:10 dimyme