[mod_python] Problem getting the Publisher handler to return nothing

Graham Dumpleton graham.dumpleton at gmail.com
Thu Jan 31 19:20:06 EST 2008


On 01/02/2008, Charles Collis <charles.collis at gmail.com> wrote:
> Hadn't tried it before, but have now - unfortunately still no joy.
>
> If I return 'apache.HTTP_NO_CONTENT' my browser then shows a blank page with
> '24' at the top which presumably is the code for 'HTTP_NO_CONTENT'.
>
> If I raise the error:
>
> raise apache.HTTP_NO_CONTENT, apache.OK (whether I put ',apache.OK' there or
> not),

Use:

  raise apache.SERVER_RETURN, apache.HTTP_NO_CONTENT

I am not sure though whether that will still trigger Apache to send a
default error page. You may have to use:

  req.status = apache.HTTP_NO_CONTENT
  raise apache.SERVER_RETURN, apache.DONE

to be absolutely sure that Apache doesn't further process it.

Graham

> I get an error message in browser saying:
> 'TypeError: exceptions must be classes, instances, or strings (deprecated),
> not int'
>
>
>
> >
> >
> >
> >
> > Have you tried returning apache.HTTP_NO_CONTENT ?
> > According to [0],
> > http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
> this should
> > cause clients do nothing. As the behaviour of the client cannot be
> > controlled except for a status code in the header, this might be an
> > option easier than creating internal requests using Ajax.
> >
>
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>
>


More information about the Mod_python mailing list