Laurent Pointal wrote: > gabor a écrit : >> hi, >> >> from the documentation (http://docs.python.org/lib/os-file-dir.html) for >> os.listdir: >> >> "On Windows NT/2k/XP and Unix, if path is a Unicode object, the result >> will be a list of Unicode objects." > > Maybe, for each filename, you can test if it is an unicode string, and > if not, convert it to unicode using the encoding indicated by > sys.getfilesystemencoding(). > > Have a try. > > A+ > > Laurent.
Strange coincident, as I was wrestling with this problem only yesterday. I found this most illuminating discussion on the topic with contributions from Mr Lövis and others: http://www.thescripts.com/forum/thread41954.html /johan -- http://mail.python.org/mailman/listinfo/python-list