[mod_python] Re: [patch] vampire 1.1 remove unknown query variables

Graham Dumpleton grahamd at dscpl.com.au
Tue Oct 19 18:22:46 EDT 2004

On Oct 19 13:56, Johannes Erdfelt <johannes at erdfelt.com> wrote:
> Subject: [patch] vampire 1.1 remove unknown query variables
> +    # We definately had some missing variables, let's let the user know
> +    req.content_type = "text/plain"
> +    req.status = apache.HTTP_INTERNAL_SERVER_ERROR
> +    req.send_http_header()
> +    req.write("Call is missing these variables: %s\n" % ", ".join(missing))
> +
> +    return apache.OK

I am a bit wary of directly generating an error response from this point in
the code.

What may be better is to raise a Python RuntimeWarning exception with the
description of the problem. This will cause mod_python to still return an
internal server error, but one where the details would only be visible when
PythonDebug option is set to On. The error would also be logged into the
log file automatically.

Anyway, still have to come to grips with the whole patch and what it does.
Now that I am at work, will have a bit of time to consume what it does. I have
a couple of other questions to throw into the mix as well. The form validation
mechanism also looks interesting and I will need to digest that as well.

Graham Dumpleton (grahamd at dscpl.com.au)

More information about the Mod_python mailing list