[mod_python] CGIhandler Application Error

Clodoaldo clodoaldo.pinto.neto at gmail.com
Sun Feb 11 12:29:01 EST 2007

2007/2/11, Colin Rothwell <colin.rothwell at frambroadband.com>:
> 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] 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)

Try putting this line as the first line of the script:

# -*- coding: UTF-8 -*-

Replace UTF-8 with the appropriate encoding.

Note that Python names must be strictly ASCII and the above encoding
will only help in strings.

Clodoaldo Pinto Neto

More information about the Mod_python mailing list