[mod_python] UnicodeEncodeError using mod_python-3.0.3 with Python 2.3

Sean Gillies sgillies at frii.com
Thu Sep 18 12:10:07 EST 2003


Hi,

I'm running into problems with UnicodeEncodeErrors using  
mod_python-3.0.3 with
Python 2.3 on OS X.  Yes, I know I'm asking for trouble with this  
combination,
but I'm leery of replacing Apple's Python 2.2 (which doesn't work with  
mod_python).
All in all, my application is working, but will eventually (and  
unpredictably)
stop and raise this error:

Mod_python error: "PythonHandler mod_python.publisher"

Traceback (most recent call last):

   File  
"/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- 
packages/mod_python/apache.py", line 332, in HandlerDispatch
     result = object(req)

   File  
"/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- 
packages/mod_python/publisher.py", line 201, in handler
     result = str(result)

UnicodeEncodeError: 'ascii' codec can't encode character '\u3137' in  
position 412: ordinal not in range(128)

Anybody else using Python 2.3 who has seen this?  I really don't  
understand the error,
it's always '\u3137', and I'm _not_ (to my knowledge) using any unicode  
strings.  I am
using Zope's Page Templates, but I don't see where the page templates  
would be introducing
'\u3137' (the hangul letter tikeut?!).

My module is published with no problems on Linux (KRUD) with  
mod_python-3.0.1 and
Python 2.2.3, so I'm presently living with this problem on my notebook  
and counting
on its absence on the server.

Sean

--
Sean Gillies
sgillies at frii dot com
http://www.frii.com/~sgillies



More information about the Mod_python mailing list