attribute error using fnmatch

s99999999s2003 at s99999999s2003 at
Mon Jun 5 08:42:31 CEST 2006

i have script like this:

from fnmatch import fnmatch
from glob import glob
f = ['file1','file2','file3']
r = "d:\\somepath"
pat = "*.bat"
listof_files = [i for i in f if not fnmatch(os.path.join(r,i),pat) and

I get  this error:
  File "C:\Python24\Lib\", line 37, in fnmatch
    pat = os.path.normcase(pat)
  File "C:\Python24\lib\", line 42, in normcase
    return s.replace("/", "\\").lower()
AttributeError: replace

But when i do everything in interactive, there is no problem.. What
could be wrong with the script?
My purpose is to find a list of files that does not match pat...

More information about the Python-list mailing list