[mod_python] Setting HTTP response status line

Roger Binns rogerb at rogerbinns.com
Sun May 6 18:18:45 EDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Graham Dumpleton wrote:
> Where did you get the idea you could do that in the first place?

The code took two parameters and so it was a (wrong) educated guess as
to what they were :-)

> At no time can you supply an alternate status line message. Apache
> will always use its own internal versions of the strings.

That is a pity.  I was hoping to use it as part of my automated testing.

> What is more confusing is why people keep using old versions of
> mod_python 

3.2.10 wasn't released that long ago.  It is the default one supplied
with Feisty which went into freeze a few months ago (ie before 3.3.1 was
released).  If 3.3.1 was guaranteed bug free at release etc then I'm
sure they could have sneaked it in, but I doubt it or any other software
can make those guarantees :-)

>  http://issues.apache.org/jira/browse/MODPYTHON-167

That is pretty much the problem.  I ultimately solved all the issues by
writing a decorator for my handlers that checks return codes (I got
bitten a few times forgetting to return OK or DECLINED), sets the
correct codes, prints stack traces with variables (see
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52215 ) etc.

> For the status line message the answer is no. Why would you want to
> change the message from the normal one anyway?

So I can use it in my testing.  The status line is intended to be
targeted at machines and hence can be terse.  The body is longer winded
and targeted at people.  (Sure it can be done either way but it was just
something I hoped to be able to do).

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGPlREmOOfHg372QQRAjKCAJ42Kj/uxj/0WSXuO4vjp8sYUAJatgCeKSEE
no/XSBy+Qs9jJD/ax9lyi8o=
=fKps
-----END PGP SIGNATURE-----


More information about the Mod_python mailing list