wdb icon indicating copy to clipboard operation
wdb copied to clipboard

class TCPServer has no attribute 'shutdown_request' when debugging Cherrrypy webserver

Open watercrossing opened this issue 8 years ago • 1 comments

A simple webserver using cherrypy fails to debug. Cherrypy 10.0, python 2.6.

[08/Feb/2017:10:59:56] ENGINE AttributeError("class TCPServer has no attribute 'shutdown_request'",)
Traceback (most recent call last):
  File "venv/lib/python2.6/site-packages/cheroot/server.py", line 966, in communicate
    req.respond()
  File "venv/lib/python2.6/site-packages/cheroot/server.py", line 792, in respond
    self.server.gateway(self).respond()
  File "venv/lib/python2.6/site-packages/cheroot/wsgi.py", line 96, in respond
    response = self.req.server.wsgi_app(self.env, self.start_response)
  File "venv/lib/python2.6/site-packages/cherrypy/_cptree.py", line 287, in __call__
    return app(environ, start_response)
  File "venv/lib/python2.6/site-packages/cherrypy/_cptree.py", line 153, in __call__
    return self.wsgiapp(environ, start_response)
  File "venv/lib/python2.6/site-packages/cherrypy/_cpwsgi.py", line 448, in __call__
    head = callable(head, **conf)
  File "venv/lib/python2.6/site-packages/wdb/ext.py", line 121, in __init__
    _patch_tcpserver()
  File "venv/lib/python2.6/site-packages/wdb/ext.py", line 37, in _patch_tcpserver
    shutdown_request = TCPServer.shutdown_request
AttributeError: class TCPServer has no attribute 'shutdown_request'

watercrossing avatar Feb 08 '17 11:02 watercrossing

This seems non-obvious to fix. Python 2.6's SocketServer implementations do not expose a shutdown_request method that can be overwritten (compare 2.6 with 2.7). I guess one could overwrite shutdown_server instead.

watercrossing avatar Feb 08 '17 11:02 watercrossing