#1078: Using Bottle: "TypeError: WSGI response header key 'Content-Length' is not
a byte string"
------------------------+---------------------------------------------------
Reporter: rwd | Owner: fumanchu
Type: defect | Status: new
Priority: normal | Milestone:
Component: wsgiserver | Keywords:
------------------------+---------------------------------------------------
I'm using the following configuration:
Arch Linux with 2.6.32-lts kernel[[BR]]
hardware: i686 Intel(R) Atom(TM) CPU N270 @ 1.60GHz[[BR]]
python 3.2[[BR]]
cherrypy-svn 2567-1 [[BR]]
bottle 0.9.5[[BR]]
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 errormessage:
{{{
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.
}}}
--
Ticket URL: <
http://www.cherrypy.org/ticket/1078>
CherryPy <
http://www.cherrypy.org>
CherryPy - a pythonic, object-oriented HTTP framework