[mod_python] Browser doesn't display server response

Graham Dumpleton graham.dumpleton at gmail.com
Mon Jun 9 08:30:36 EDT 2008


Publisher only does it for HTML. If for some reason it doesn't
identify it as HTML it will from memory defer to Apache type handlers,
which probably will not be of any use as nothing sensible would be set
for .py extension. End result is that a browser will do its own
interpretation of what a .py extension in a URL may mean, and if it
doesn't have a mapping will treat it as a file download.

It is always safer to set content type in responses.

Graham

2008/6/9  <Dominique.Holzwarth at ch.delarue.com>:
> To be honest, I've never set the content type so far. I thought the publisher handler is smart enough to do that on it's own and it always worked =)
> Except for those rare occasions like today, which is only the case when my scripts have some errors (not "syntax" error's or so, the the mod_python debug page will show up). It's a very rare behaviour so I couldn't track the problem down yet.
>
> Next time I'll try with setting the content type =) (the script is running again so I don't get the "file download" pop-up anymore =))
>
> Greetings
> Dominique
>
>> -----Original Message-----
>> From: Graham Dumpleton [mailto:graham.dumpleton at gmail.com]
>> Sent: Montag, 9. Juni 2008 14:21
>> To: Holzwarth, Dominique (Berne Bauhaus)
>> Cc: mod_python at modpython.org
>> Subject: Re: [mod_python] Browser doesn't display server response
>>
>> Ensure you are setting content type for response.
>>
>> Graham
>>
>> 2008/6/9  <Dominique.Holzwarth at ch.delarue.com>:
>> >
>> > Hi all
>> >
>> > I recently got the error that the browser doesn't display
>> the server
>> > response generated by some python scripts anymore but
>> instead I get a
>> > "File Download" Pop-up with:
>> >
>> > Name: myFileName.py
>> > Type: py_auto_file
>> > From: server-name
>> >
>> > That behaviour does NOT apply to every script so I guess
>> there must be
>> > something wrong with certain scripts that confuse
>> apache/mod_python?
>> > Or could it maybe have something to do with the apache
>> configuration
>> > (mentioning it because I adjusted it slightly)?
>> >
>> > Would be nice if someone has an idea what could cause this strange
>> > behaviour... :-/
>> >
>> > Greetings
>> > Dominique
>> >
>> >
>> **********************************************************************
>> > ******* This e-mail and any files attached are strictly
>> confidential,
>> > may be legally privileged and are intended solely for the
>> addressee.
>> > If you are not the intended recipient please notify the sender
>> > immediately by return email and then delete the e-mail and any
>> > attachments immediately.
>> >
>> > The views and or opinions expressed in this e-mail are not
>> necessarily
>> > the views of De La Rue plc or any of its subsidiaries and the De La
>> > Rue Group of companies, their directors, officers and
>> employees make
>> > no representation about and accept no liability for its
>> accuracy or completeness.
>> >
>> > You should ensure that you have adequate virus protection
>> as the De La
>> > Rue Group of companies do not accept liability for any viruses.
>> >
>> > De La Rue plc Registered No.3834125, De La Rue Holdings plc
>> Registered
>> > No 58025 and De La Rue International Limited Registered No
>> 720284 are
>> > all registered in England with their registered office at:
>> > De La Rue House, Jays Close, Viables, Hampshire RG22 4BS
>> >
>> **********************************************************************
>> > *******
>> >
>> > _______________________________________________
>> > Mod_python mailing list
>> > Mod_python at modpython.org
>> > http://mailman.modpython.org/mailman/listinfo/mod_python
>> >
>> >
>>
>>
>
> *****************************************************************************
> This e-mail and any files attached are strictly confidential, may be legally
> privileged and are intended solely for the addressee. If you are not the
> intended recipient please notify the sender immediately by return email and
> then delete the e-mail and any attachments immediately.
>
> The views and or opinions expressed in this e-mail are not necessarily the
> views of De La Rue plc or any of its subsidiaries and the De La Rue Group
> of companies, their directors, officers and employees make no representation
> about and accept no liability for its accuracy or completeness.
>
> You should ensure that you have adequate virus protection as the De La Rue
> Group of companies do not accept liability for any viruses.
>
> De La Rue plc Registered No.3834125, De La Rue Holdings plc Registered
> No 58025 and De La Rue International Limited Registered No 720284 are all
> registered in England with their registered office at:
> De La Rue House, Jays Close, Viables, Hampshire RG22 4BS
> *****************************************************************************
>
>


More information about the Mod_python mailing list