You may get more appropriate responses on the python-list mailing list, as this is not really a django question, but a python one.
http://mail.python.org/mailman/listinfo/python-list On Sun, Nov 20, 2011 at 12:57 PM, Marc <mrec...@gmail.com> wrote: > Hello, > > I have an application that uses os.listdir(u'some path') that should > return a list of unicode strings. > > This works fine as long as I use the manage.py runserver server. > > As soon as I deploy on Apache with mod_wsgi, I get the Caught > UnicodeDecodeError while rendering: 'ascii' codec can't decode byte > 0xc3 in position 15: ordinal not in range(128) for the same piece of > code. > > I discovered that the problem is that the os.listdir() does not return > unicode but byte strings although the requested path is unicode. > > What could be wrong please ? > > Python 2.7.2 > Linux 3.1.0-4-pae > Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/1.0.0e DAV/2 PHP/5.3.8 > with Suhosin-Patch mod_wsgi/3.3 Python/2.7.2 > > > -- > 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. > > -- Read my blog! I depend on your acceptance of my opinion! I am interesting! http://techblog.ironfroggy.com/ Follow me if you're into that sort of thing: http://www.twitter.com/ironfroggy -- 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.