[Python-bugs-list] [ python-Bugs-404539 ] os.listdir() can't grok Unicode filename
nobody
nobody@sourceforge.net
Tue, 27 Feb 2001 01:15:16 -0800
Artifact #404539, was updated on 2001-02-27 01:15
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=404539&group_id=5470
Category: Unicode
Group: Feature Request
Status: Open
Priority: 5
Submitted By: Itamar S.T.
Assigned to: Nobody/Anonymous
Summary: os.listdir() can't grok Unicode filename
Initial Comment:
I have a file whose name is part Hebrew, part English
on my W2K VMware install. Filenames on Win2000 are
Unicode, if I'm not mistaken. I'm running BeOpen Python
2.0, with the latest Pythonwin installed.
My problem - the os.listdir() command doesn't return
the name of the file in unicode, it just replaces the
hebrew characters with question marks - '?':
>>> l = os.listdir("c:\")
>>> l[-1]
'????.txt'
>>> type(l[-1])
<type 'string'>
Perhaps the os.listdir() function could be extended
with a unicode keyword, which would tell it to return
the filenames as unicode strings?
filenames = os.listdir(path, unicode=1)
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=404539&group_id=5470