[mod_python] CGIhandler Application Error

Colin Rothwell colin.rothwell at frambroadband.com
Sun Feb 11 12:09:03 EST 2007


Hi All,

I'm quite new to python and very new mod_python. I have written a simple 
app in the form of a CGI script which I am trying to get running CGIHandler.
The webserver setup I am using is Apache 2.2.4, Python 2.5 and 
mod_python 3.3.0b.
This is a copy of the error.log info I get when I run the app. If you 
need a copy of the app I can e-mail it to you.


[Sun Feb 11 15:41:28 2007] [error] [client 127.0.0.1] mod_python 
(pid=2680, interpreter='www.theboff.net', phase='PythonHandler', 
handler='mod_python.cgihandler'): Application error
[Sun Feb 11 15:41:28 2007] [error] [client 127.0.0.1] ServerName: 
'www.theboff.net'
[Sun Feb 11 15:41:28 2007] [error] [client 127.0.0.1] DocumentRoot: 
'D:/Apache2.2/htdocs'
[Sun Feb 11 15:41:28 2007] [error] [client 127.0.0.1] URI: 
'/accounts/accounts.py'
[Sun Feb 11 15:41:28 2007] [error] [client 127.0.0.1] Location: None
[Sun Feb 11 15:41:28 2007] [error] [client 127.0.0.1] Directory: 
'D:/Apache2.2/htdocs/accounts/'
[Sun Feb 11 15:41:28 2007] [error] [client 127.0.0.1] Filename: 
'D:/Apache2.2/htdocs/accounts/accounts.py'
[Sun Feb 11 15:41:28 2007] [error] [client 127.0.0.1] PathInfo: ''
[Sun Feb 11 15:41:28 2007] [error] [client 127.0.0.1] Traceback (most 
recent call last):
[Sun Feb 11 15:41:28 2007] [error] [client 127.0.0.1]   File 
"D:\\Python25\\Lib\\site-packages\\mod_python\\importer.py", line 1537, 
in HandlerDispatch\n    default=default_handler, arg=req, 
silent=hlist.silent)
[Sun Feb 11 15:41:28 2007] [error] [client 127.0.0.1]   File 
"D:\\Python25\\Lib\\site-packages\\mod_python\\importer.py", line 1229, 
in _process_target\n    result = _execute_target(config, req, object, arg)
[Sun Feb 11 15:41:28 2007] [error] [client 127.0.0.1]   File 
"D:\\Python25\\Lib\\site-packages\\mod_python\\importer.py", line 1128, 
in _execute_target\n    result = object(arg)
[Sun Feb 11 15:41:28 2007] [error] [client 127.0.0.1]   File 
"D:\\Python25\\Lib\\site-packages\\mod_python\\cgihandler.py", line 96, 
in handler\n    imp.load_module(module_name, fd, path, desc)
[Sun Feb 11 15:41:28 2007] [error] [client 127.0.0.1]   File 
"D:/Apache2.2/htdocs/accounts\\accounts.py", line 52
[Sun Feb 11 15:41:28 2007] [error] [client 127.0.0.1] SyntaxError: 
Non-ASCII character '\\xa3' in file 
D:/Apache2.2/htdocs/accounts\\accounts.py on line 52, but no encoding 
declared; see http://www.python.org/peps/pep-0263.html for details 
(accounts.py, line 52)

Being a python noivce I have absolutely no idea as to how to solve this 
problem. The app seems to work fine because running it with it's output 
redirected to a .html file produces the desired output.

Thanks in advance,
Colin



More information about the Mod_python mailing list