[mod_python] mod_python wont use version 2.5.4 on windows

Graham Dumpleton graham.dumpleton at gmail.com
Mon Mar 9 18:45:49 EDT 2009


2009/3/10 Tim Valenta <tonightslastsong at gmail.com>:
> 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 <jdunn at nodetwo.org> 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 <tonightslastsong at gmail.com>
>> 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
>>> <graham.dumpleton at gmail.com> wrote:
>>>>
>>>> 2009/3/10 Jordan Dunn <jdunn at nodetwo.org>:
>>>> > 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
>>>> > <graham.dumpleton at gmail.com> 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 <tonightslastsong at gmail.com>:
>>>> >> > 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 <jdunn at nodetwo.org>
>>>> >> >>
>>>> >> >> 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
>>>> >> >> Mod_python at modpython.org
>>>> >> >> http://mailman.modpython.org/mailman/listinfo/mod_python
>>>> >> >>
>>>> >> >
>>>> >> >
>>>> >> >
>>>> >> > --
>>>> >> > "If you had a katana, ..."
>>>> >> > Party like it's 1234567890
>>>> >> >
>>>> >> > _______________________________________________
>>>> >> > Mod_python mailing list
>>>> >> > Mod_python at modpython.org
>>>> >> > http://mailman.modpython.org/mailman/listinfo/mod_python
>>>> >> >
>>>> >> >
>>>> >
>>>> >
>>>>
>>>> _______________________________________________
>>>> Mod_python mailing list
>>>> Mod_python at modpython.org
>>>> 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
>



More information about the Mod_python mailing list