Bug in glob.glob for files w/o extentions in Windows
see_signature__ at hotmail.com
Sun Nov 30 05:30:09 CET 2003
OK, you can call it not a bug, but different behavior.
I've found that the fnmatch module is the reason for that.
Here's other examples:
C:\temp>dir /b *.*
C:\temp>dir /b * # it's by def synonym for *.*
C:\temp>dir /b .*
C:\temp>dir /b *. # it looks strange too
>>> import glob
It seems that in any case I'll have to extract 'nnn' by myself.
if mask.endswith('.'): # no extention implies actually no dots in name at all
list = glob.glob( mask[:-1] )
list = filter( lambda x: '.' not in x, list ) # or [x for x in list if '.' not in x]
list = glob.glob( mask )
More information about the Python-list