[Tutor] listdir, ispath and unicode (followup question)

Poor Yorick gp@pooryorick.com
Fri, 02 Aug 2002 10:44:03 -0600


I created the files using the Windows 2000 file manager, explorer.exe, 
not in the dos window.  As Danny Yoo pointed out, the issue is probably 
that Python 2.2 translates unicode to 'mbcs' (whatever that is):

http://www.python.org/peps/pep-0277.html

I havne't yet tried the experimental implementation, but my Windows 2000 
setup, English locale, additional keyboards and IME's, matches the 
conditions specified in pep-0277.

Thank you for your responses.

Poor Yorick



alan.gauld@bt.com wrote:

>> >>> filename = os.path.join(os.getcwd(), os.listdir(os.getcwd())[0])
>> >>> filename
>>'d:\\tmp2\\???????'
>> >>> os.path.isfile(filename)
>>0
>>
>
>>The file, 'd:\\tmp2\\???????', is a text file which I created for 
>>testing this problem.  
>>
>
>Hmm, I'm surprised you could create that.
>The '?' character is a wildcard character in DOS so
>that you can, for example, specify:
>
>foo??.doc
>
>In explorer and get a list of all the .doc files starting 
>with foo then 2 characters. eg foo01.doc, foo02.doc etc
>
>So a file ??????? will match any file that has exactly 
>7 characters in its name and no extension.
>
>What happens when you create a file called "???????" I 
>have no idea! Its probably a bad policy IMHO
>
>Alan G.
>
>_______________________________________________
>Tutor maillist  -  Tutor@python.org
>http://mail.python.org/mailman/listinfo/tutor
>
>