[mod_python] Problem getting the Publisher handler to return nothing

Graham Dumpleton graham.dumpleton at gmail.com
Sun Jan 27 16:12:36 EST 2008


You still must set the response content type else the browser tries to
work out what to do based on the extension in the URL. So, use:

  req.content_type = 'text/plain'

Graham

On 28/01/2008, Charles Collis <charles.collis at gmail.com> wrote:
> Hi.
>
> I wonder if anyone can help - I am having problems getting the Publisher
> handler to return nothing.
>
> I am wanting the publisher handler to return nothing when clicking on a link
> that points to a particular function which will perform a system command,
> and I am using the recommended 'raise apache.SERVER_RETURN, apache.OK'
> trick.
>
> This does indeed stop the page contents refreshing, but has the odd
> side-effect of the browser asking wanting to download a file (of 'python
> script' type). This behaviour happens in both Firefox 3 beta2 and Konqueror.
> It even does it if the function doesn't do anything:
>
> def launch():
>    pass
>    raise apache.SERVER_RETURN, apache.OK
>
> I am running Ubuntu Gutsy.
>
> Apache and mod_python details:
> Apache/2.2.4 (Ubuntu) mod_python/3.3.1 Python/2.5.1 PHP/5.2.3-1ubuntu6.3
>
> Any pointers appreciated. Thanks.
>
> Charles Collis.
>
> _______________________________________________
> 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