Re: mod_python wont use version 2.5.4 on windows

Graham Dumpleton <[email protected]>
Newsgroups gmane.comp.python.mod_python
Message-ID <[email protected]>
2009/3/10 Tim Valenta <[email protected]>:
> I know I still did.  I haven't used psp.  You could set your default Apache
> content type to be 'text/html' if you want, and then you wouldn't have to do
> it manually each time.  But whatever fits your situation is best.

Do not override the default Apache content type as it will effect the
whole server.

PSP handler should already set req.content_type to 'text/html'.

The publisher handler will try and guess whether returned content is
text/html if not explicitly set. This guess isn't done though where
req.write() is used, only being done where response is returned as
string from publisher function. The guessing code tries to determine
if it is HTML by looking at last 100 characters of the response and
seeing if it matches regex:

re_html = re.compile(r"</HTML\s*>\s*$",re.I)

If for some reason the closing HTML tag is missing or badly formatted
it will not know it is HTML.

The safest way is always to set req.content_type explicitly.

Graham

> Tim
>
> On Mon, Mar 9, 2009 at 4:09 PM, Jordan Dunn <[email protected]> wrote:
>>
>> do you have to set that if your using publisher instead of psp?
>>
>> On Mon, Mar 9, 2009 at 4:52 PM, Tim Valenta <[email protected]>
>> wrote:
>>>
>>> Make sure you set the content type to text/html instead of what the
>>> default is.  I don't think mod_python is going to do that part for you.
>>> http://www.modpython.org/pipermail/mod_python/2006-November/022587.html
>>>
>>> On Mon, Mar 9, 2009 at 3:42 PM, Graham Dumpleton
>>> <[email protected]> wrote:
>>>>
>>>> 2009/3/10 Jordan Dunn <[email protected]>:
>>>> > the only problem in having is that in IE7 it is printing the source
>>>> > instead
>>>> > of just the html.
>>>>
>>>> Unrelated. If you are having that problem you mustn't be configuring
>>>> Apache correctly for your specific mod_python application.
>>>>
>>>> Please use reply-all and keep followups on the list.
>>>>
>>>> Graham
>>>>
>>>> > On Mon, Mar 9, 2009 at 4:30 PM, Graham Dumpleton
>>>> > <[email protected]> wrote:
>>>> >>
>>>> >> Correct, it is effectively a warning only in this case. Because
>>>> >> Windows uses a DLL for Python library it automatically picks up the
>>>> >> newer version.
>>>> >>
>>>> >> It would however be a problem on UNIX if mod_python had been compiled
>>>> >> against a static Python library instead of a shared library.
>>>> >>
>>>> >> Graham
>>>> >>
>>>> >> 2009/3/10 Tim Valenta <[email protected]>:
>>>> >> > If I'm not mistaken, I think it still runs, right?  It does give a
>>>> >> > warning,
>>>> >> > but that is because that version was compiled with Python 2.5
>>>> >> > (straight
>>>> >> > 2.5,
>>>> >> > not 2.5.2 or 2.5.4)
>>>> >> > I'm not sure if there's anything you'll be able to simply change to
>>>> >> > fix
>>>> >> > it.
>>>> >> >  It shouldn't have any problems though.  (At least, I haven't
>>>> >> > experienced
>>>> >> > any.)
>>>> >> > Tim
>>>> >> >
>>>> >> > 2009/3/9 Jordan Dunn <[email protected]>
>>>> >> >>
>>>> >> >> i installed apache2.2 and python 2.5.4, and when i installed
>>>> >> >> mod_python
>>>> >> >> it
>>>> >> >> installed fine, but in the apache logs it says its looking for 2.5
>>>> >> >> instead
>>>> >> >> of 2.5.4? how can i fix this?
>>>> >> >> _______________________________________________
>>>> >> >> Mod_python mailing list
>>>> >> >> [email protected]
>>>> >> >> http://mailman.modpython.org/mailman/listinfo/mod_python
>>>> >> >>
>>>> >> >
>>>> >> >
>>>> >> >
>>>> >> > --
>>>> >> > "If you had a katana, ..."
>>>> >> > Party like it's 1234567890
>>>> >> >
>>>> >> > _______________________________________________
>>>> >> > Mod_python mailing list
>>>> >> > [email protected]
>>>> >> > http://mailman.modpython.org/mailman/listinfo/mod_python
>>>> >> >
>>>> >> >
>>>> >
>>>> >
>>>>
>>>> _______________________________________________
>>>> Mod_python mailing list
>>>> [email protected]
>>>> http://mailman.modpython.org/mailman/listinfo/mod_python
>>>
>>>
>>>
>>> --
>>> "If you had a katana, ..."
>>> Party like it's 1234567890
>>
>
>
>
> --
> "If you had a katana, ..."
> Party like it's 1234567890
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.