Issue #1051 resolved

mod_python 'NoneType' object is not subscriptable

Anonymous created an issue

Wanting to run a cherrpy application using apache2+mod_python I tried the sample at DeployTemplate, but even using that code it does not work, all I get is this exception in 'site.log':

{{{ [02/Mar/2011:14:06:37] MOD_PYTHON Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/cherrypy/", line 229, in handler response.body, File "/usr/lib/python2.7/site-packages/cherrypy/", line 247, in send_response req.status = int(status[:3]) TypeError: 'NoneType' object is not subscriptable }}}

my .htaccess is as following: {{{ SetHandler python-program

PythonPath "sys.path+['/path/to/code']" PythonHandler cherrypy._cpmodpy::handler PythonOption cherrypy.setup myapp::serverless PythonDebug On }}}

To further find more details, I've added some print statements to and here is the arguments for send_response: {{{ req: <mp_request object at 0xbe676ac> status: None headers: [('Date', 'Wed, 02 Mar 2011 13:20:58 GMT'), ('Content-Length', '12'), ('Content-Type', 'text/html;charset=ISO-8859-1'), ('Server', 'CherryPy/3.2.0')] body: ['Hello World!'] stream: False }}}

It all looks fine, except that 'status' is not set.

I am running the following versions: * apache-2.2.17 * mod_python-3.3.1 * cherrypy-3.2.0

Reported by

Comments (2)

  1. Log in to comment