When LANG = C, os.stat(u'中文.txt') will make a error.

UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-5:
ordinal not in range(128)

os.environ['LANG']='utf8'
os.stat(u'中文.txt') also makes that error.

In my program, I tried SetEnv, adding export LANG='utf8' in envvars, but
they all were not usefull.
So I think os.stat() has nothing to do with os.environ['LANG'].

So it must be mod_python has bug.

I changed mod_python to mod_wsgi. That error didn't occur again.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to