bottle+cherrypy gives ""TypeError: WSGI response header key 'Content-Length' is not a byte string"
See original GitHub issueI am not sure if this is a bottle or a cherrypy issue, but anyway
I’m using the following configuration:
Arch Linux with 2.6.32-lts kernel hardware: i686 Intel® Atom™ CPU N270 @ 1.60GHz python 3.2 cherrypy-svn 2567-1 bottle 0.9.5
Both a Bottle and a Cherrypy ‘hello world’ run fine. But when I try to run Bottle with Cherrypy like this:
from bottle import route, run
@route(‘/’) def hello(): return ‘hello world’
run(server=‘cherrypy’,host=‘192.168.1.5’, port=8080)
I get this error message:
Traceback (most recent call last): File “/usr/lib/python3.2/site-packages/bottle.py”, line 743, in wsgi start_response(status, response.headerlist) File “/usr/lib/python3.2/site-packages/cherrypy/wsgiserver/wsgiserver3.py”, line 1846, in start_response raise TypeError(“WSGI response header key %r is not a byte string.” % k) TypeError: WSGI response header key ‘Content-Length’ is not a byte string.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “/usr/lib/python3.2/site-packages/cherrypy/wsgiserver/wsgiserver3.py”, line 1034, in communicate req.respond() File “/usr/lib/python3.2/site-packages/cherrypy/wsgiserver/wsgiserver3.py”, line 830, in respond self.server.gateway(self).respond() File “/usr/lib/python3.2/site-packages/cherrypy/wsgiserver/wsgiserver3.py”, line 1808, in respond response = self.req.server.wsgi_app(self.env, self.start_response) File “/usr/lib/python3.2/site-packages/bottle.py”, line 759, in call return self.wsgi(environ, start_response) File “/usr/lib/python3.2/site-packages/bottle.py”, line 755, in wsgi start_response(‘500 INTERNAL SERVER ERROR’, [(‘Content-Type’, ‘text/html’)]) File “/usr/lib/python3.2/site-packages/cherrypy/wsgiserver/wsgiserver3.py”, line 1830, in start_response raise AssertionError("WSGI start_response called a second " AssertionError: WSGI start_response called a second time with no exc_info. `
Issue Analytics
- State:
- Created 12 years ago
- Comments:10 (9 by maintainers)
Top GitHub Comments
for future reference the cherrypy ticket is now here: https://github.com/cherrypy/cherrypy/issues/1087
Thanks for the feedback. Fixed upstream -> closed