os.listdir is removing character accent os.listdir is removing character accent windows windows

os.listdir is removing character accent


Use u before that:

>>> print os.listdir(u".")[u'\u0143.txt']>>> print map(os.path.exists,os.listdir(u"."))[True]

os.listdir(path):

Changed in version 2.3: On Windows NT/2k/XP and Unix, if path is a Unicode object, the result will be a list of Unicode objects. Undecodable filenames will still be returned as string objects.