isdir, isfile broken under windows XP?

Ian McMeans imcmeans at telus.net
Thu May 22 02:26:49 EDT 2003


Perhaps I'm using them incorrectly, but it seems like os.path.isdir
and os.path.isfile are working incorrectly.

>>> os.listdir(r'f:\\')
['Apache2', 'console.log', 'Crimsonland', 'cygwin', 'movies',
'mozilla', 'mp3s', 'nerd stuff', 'new', 'pics', 'RECYCLER',
'soundforge', 'source', 'text', 'WINAMP']
>>> filter(os.path.isfile, os.listdir(r'f:\\'))
[]
>>> filter(os.path.isdir, os.listdir(r'f:\\'))
['RECYCLER']

Now, all of those enties of listdir's output are either files or
directories, but they aren't being listed as such. This seems
incorrect to me, and doesn't match the documentation.

This is "Python 2.3b1 (#40, Apr 25 2003, 19:06:24) [MSC v.1200 32 bit
(Intel)] on win32", running on windows XP. Am I being stupid, or have
I found a bug?




More information about the Python-list mailing list