2009/12/25 Mark Sapiro <[email protected]>:
> On Dec 24, 11:36 am, Chris McDonough <[email protected]> wrote:
>> This has almost nothing to do with mod_wsgi at all, I fear. The warning
>> message you're receiving come as a result of using an ".so" file generated
>> via
>> compilation using one version of Python but used under another version of
>> Python. In the interest of protecting Graham, I'd suggest that you compile
>> gdchart using the version of Python used by mod_wsgi itself.
>
>
> Thanks for your reply.
>
> Please note that this question is not about gdchart per se. The
> question is why can't I suppress a warning message by calling
> warnings.filterwarnings()
>
> Since posting this question I have stumbled across the new in wsgi 3.0
> WSGIPythonWarnings directive, and I understand that that would
> probably be effective in suppressing this warning, although I haven't
> tried it. But the question still remains - why is a call to
> warnings.filterwarnings() from the wsgi script not effective?
>From memory because warnings.filterwarnings() only works when used in
main Python interpreter and doesn't work in sub interpreters.
You can test this theory by forcing your application to run in main
Python interpreter using:
WSGIApplicationGroup %{GLOBAL}
You'll only really be able to do this if hosting the one application
in embedded mode, or only if delegating each application to separate
daemon mode process group.
WSGIPythonWarnings will work because it does its work even before
Python initialised and the settings it configures will be correctly
inherited by Python sub interpreters.
As to the warning, you are best off trying to get hold of source and
recompiling for correct version of Python.
Graham
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/modwsgi?hl=en.