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.

- C

Mark Sapiro wrote:
> Background:
> 
> I run MoinMoin on my site. I have a gdchart module (gdchart.so
> library) that seems to work for MoinMoin's charting purposes, and I
> have been using it in this context for some time. However, this module
> was built with an older Python so whenever it is imported, Python
> issues
> 
> RuntimeWarning: Python C API version mismatch for module gdchart: This
> Python has API version 1012, module gdchart has version 1011.
> 
> In order to suppress this warning I added
> 
> # supress gdchart API warning
> from warnings import filterwarnings
> filterwarnings('ignore', 'Python C API version mismatch',
> RuntimeWarning)
> 
> to my MoinMoin configuration file wikiconfig.py. This was effective
> when I was running MoinMoin as a CGI.
> 
> Problem:
> 
> I have changed to running MoinMoin via WSGI and the suppression is no
> longer effective. I am running WSGI in daemon mode with the following
> in httpd.conf
> 
>     WSGISocketPrefix /var/run/wsgi
>     WSGIDaemonProcess wsgi-gpc user=gpc group=gpc home=/var/www/grizz
> umask=0002 display-name=wsgi-gpc
>     WSGIProcessGroup wsgi-gpc
>     WSGIScriptAlias /gpc "/var/www/grizz/moin/gpc/moin.wsgi"
> 
> When the daemon starts, the first web interaction issues
> 
> [error] /usr/lib/python2.4/site-packages/MoinMoin/config/
> multiconfig.py:305: RuntimeWarning: Python C API version mismatch for
> module gdchart: This Python has API version 1012, module gdchart has
> version 1011.
> 
> I even tried adding
> 
> # supress gdchart API warning
> from warnings import filterwarnings
> filterwarnings('ignore', 'Python C API version mismatch',
> RuntimeWarning)
> 
> to the beginning of the moin.wsgi script, but I still get the warning
> message.
> 
> The warning itself is not a big deal, but my inability to suppress it
> indicates there is something I don't understand and that is what
> concerns me.
> 
> This is Apache 2.3, Python 2.4.3, mod_wsgi 3.1 and I do not load
> mod_python.
> 
> --
> 
> 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.
> 
> 

--

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.


Reply via email to