jvandal / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

Add directive equivalent to Python -W option to control Python warning messages. #137

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The 'python' executable accepts the -W option for controlling output of Python 
warnings. When 
running under mod_wsgi there is no equivalent.

One can modify sys.warnoptions from inside WSGI script file, but by then 
probably to late as 
'warnings' module probably already imported and the value it held parsed and 
cached in other 
variables.

Thus perhaps better provide a directive WSGIPythonWarnings that can only be 
used at global 
Apache scope and acts like -W option. Note that must be able to supply the 
directive multiple times 
and for result to be cumulative.

Original issue reported on code.google.com by Graham.Dumpleton@gmail.com on 10 Mar 2009 at 3:47

GoogleCodeExporter commented 8 years ago
Change made in revision r1222 of trunk for mod_wsgi 3.0.

Original comment by Graham.Dumpleton@gmail.com on 10 Mar 2009 at 9:44

GoogleCodeExporter commented 8 years ago
Python 3.0 changes type of argument for function used to setup warnings.

root@r12276:~/mod_wsgi# svn update
U    mod_wsgi.c
Updated to revision 1226.

root@r12276:~/mod_wsgi# CFLAGS="-O2" ./configure --with-python=/usr/
bin/python3.1 --with-apxs=/usr/httpd/bin/apxs
checking Apache version... 2.2.11
configure: creating ./config.status
config.status: creating Makefile

root@r12276:~/mod_wsgi# make
/usr/httpd/bin/apxs -c -I/usr/include/python3.1 -DNDEBUG   mod_wsgi.c -
Wl,-L/usr/lib -Wl,-L/usr/lib/python3.1/config -Wl,-lpython3.1 -Wl,-
lpthread -Wl,-ldl -Wl,-lutil -Wl,-lm
/usr/httpd/build/libtool --silent --mode=compile gcc -prefer-pic -O2  -
DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/
usr/httpd/include  -I/usr/httpd/include   -I/usr/httpd/include  -I/usr/
include/python3.1 -DNDEBUG  -c -o mod_wsgi.lo mod_wsgi.c && touch
mod_wsgi.slo
mod_wsgi.c: In function ‘wsgi_python_init’:
mod_wsgi.c:5230: warning: passing argument 1 of ‘PySys_AddWarnOption’
from incompatible pointer type
/usr/httpd/build/libtool --silent --mode=link gcc -o mod_wsgi.la  -
rpath /usr/httpd/modules -module -avoid-version    mod_wsgi.lo -Wl,-L/
usr/lib -Wl,-L/usr/lib/python3.1/config -Wl,-lpython3.1 -Wl,-lpthread -
Wl,-ldl -Wl,-lutil -Wl,-lm

Original comment by Graham.Dumpleton@gmail.com on 11 Mar 2009 at 12:37

GoogleCodeExporter commented 8 years ago
Python 3.0 compiler issue addressed in revision 1227.

Original comment by Graham.Dumpleton@gmail.com on 11 Mar 2009 at 6:11

GoogleCodeExporter commented 8 years ago
Version 3.0 of mod_wsgi now released with this change.

Original comment by Graham.Dumpleton@gmail.com on 22 Nov 2009 at 3:00