I disagree. I think this (here) is a good place to ask. I am a beginner in Django, but I am advanced in Python. The truth is that os.listdir() with unicode argument should return unicode strings (and it really does when executed at console -- which is also the case of running local server through manage.py). This is likely the problem of Apache or something related, and asking here is closer to the source than asking in Python groups.
______________________________________________________________ > Od: "Calvin Spealman" > Komu: <[email protected]> > Datum: 20.11.2011 21:23 > Předmět: Re: os.listdir() not returning unicode > 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 <[email protected]> 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]. > 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

